OrientDB Manual

Console - RESTORE

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>


  • backup-file is the backup input file path to restore


orientdb> restore database /backups/mydb.zip

Restore executed in 6,33 seconds

Restore API

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);


  • in: InputStream used to read the backup content. Use a FileInputStream to read the backup content from disk
  • options: Backup options as Map object
  • callable: Callback to execute when the database is locked iListener: Listener called for backup messages
  • compressionLevel: ZIP Compression level between 0 (no compression) and 9 (maximum). The bigger is the compression, the smaller will be the final backup content, but will consume more CPU and time to execute
  • bufferSize: Buffer size in bytes, the bigger is the buffer, the more efficient will be the compression


ODatabaseDocumentTx db = new ODatabaseDocumentTx("plocal:/temp/mydb");
db.open("admin", "admin");
  OCommandOutputListener listener = new OCommandOutputListener() {
    public void onMessage(String iText) {

  InputStream out = new FileInputStream("/temp/mydb.zip");
} finally {

See also