OrientDB Manual 1.7.8

Console - BACKUP

Executes a complete backup against the currently opened database. The backup file is compressed using the ZIP algorithm. To restore the database use the Restore Database command. Backup is much faster than Export Database. Look also to Export Database and Import Database commands. Backup can be done automatically by enabling the Automatic-Backup Server plugin.

NOTE: Backup of remote databases is not supported in Community Edition, but only in Enterprise Edition. If you're using the Enterprise Edition look at Remote Backup.


backup database <output-file> [-compressionLevel=<compressionLevel>] [-bufferSize=<bufferSize>]


  • output-file is the output file path
  • compressionLevel the compression level between 0 and 9. Default is 9. Since v1.7.
  • bufferSize the compression buffer size. Default is 1MB. Since v1.7.


orientdb> connect plocal:../databases/mydatabase admin admin
orientdb> backup database /backups/mydb.zip

Backuping current database to: database mydb.zip...

Backup executed in 0,52 seconds

Backup API

Backup can be executed in Java and any language on top of the JVM by using the method backup() against the database instance:

db.backup(out, options, callable, listener, compressionLevel, bufferSize);


  • out: OutputStream used to write the backup content. Use a FileOutputStream to make the backup persistent on 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) {

  OutputStream out = new FileOutputStream("/temp/mydb.zip");
} finally {

See also