ODocument doc = createPerson(db);
file = File.createTempFile("export-", ".gz", util.getTmpDir());
log("Exporting to: {}", file);
ODatabaseExport exporter = new ODatabaseExport(db, file.getPath(), new OCommandOutputListener() {
@Override
public void onMessage(final String text) {
log("> {}", text.trim());
}
});
exporter.exportDatabase();
}
try (ODatabaseDocumentTx db = createDatabase("test2")) {
log("Importing from: {}", file);
ODatabaseImport importer = new ODatabaseImport(db, file.getPath(), new OCommandOutputListener() {
@Override
public void onMessage(final String text) {
log("> {}", text.trim());
}
});