Logger.info("...drop the O-Classes...");
db.getMetadata().getSchema().dropClass("OFunction");
db.getMetadata().getSchema().dropClass("OSchedule");
db.getMetadata().getSchema().dropClass("ORIDs");
ODatabaseDocumentTx dbd = new ODatabaseDocumentTx(db);
ODatabaseImport oi = new ODatabaseImport(dbd, f.getAbsolutePath(), new OCommandOutputListener() {
@Override
public void onMessage(String m) {
Logger.info("Restore db: " + m);
}
});
oi.setIncludeManualIndexes(true);
oi.setUseLineFeedForRecords(true);
oi.setPreserveClusterIDs(true);
oi.setPreserveRids(true);
Logger.info("...starting import procedure...");
oi.importDatabase();
oi.close();
Logger.info("...setting up internal user credential...");
updateDefaultUsers();
Logger.info("...setting up DataBase attributes...");
setupAttributes();