Executes a restore of current opened database. The backup file is created using the Backup Database command. Look also to Export Database and Import Database commands.
restore database <backup-file>
Where:
orientdb> restore database /backups/mydb.zip
Restore executed in 6,33 seconds
Restore can be executed in Java and any language on top of the JVM by using the method restore() against the database instance:
db.restore(in, options, callable, listener);
Where:
Example:
ODatabaseDocumentTx db = new ODatabaseDocumentTx("plocal:/temp/mydb");
db.open("admin", "admin");
try{
OCommandOutputListener listener = new OCommandOutputListener() {
@Override
public void onMessage(String iText) {
System.out.print(iText);
}
};
InputStream out = new FileInputStream("/temp/mydb.zip");
db.restore(in,null,null,listener);
} finally {
db.close();
}