Console - BACKUP
Executes a complete backup on the currently opened database. It then compresses the backup file using the ZIP algorithm. You can then restore a database from backups, using the RESTORE DATABASE
command. You can automate backups using the Automatic-Backup server plugin.
Backups and restores are similar to the EXPORT DATABASE
and IMPORT DATABASE
, but they offer better performance than these options.
NOTE: OrientDB Community Edition does not support backing up remote databases. OrientDB Enterprise Edition does support this feature. For more information on how to implement this with Enterprise Edition, see Remote Backups.
Syntax:
BACKUP DATABASE <output-file> [-incremental] [-compressionLevel=<compressionLevel>] [-bufferSize=<bufferSize>]
<output-file>
Defines the path to the backup file.-incremental
Option to execute an incremental backup. When enabled, it computes the data to backup as all new changes since the last backup. Available only in the OrientDB Enterprise Edition version 2.2 or later.- -
compressionLevel
Defines the level of compression for the backup file. Valid levels are0
to9
. The default is9
. Available in 1.7 or later. -bufferSize
Defines the compression buffer size. By default, this is set to 1MB. Available in 1.7 or later.
Permissions:
In order to enable a user to execute this command, you must add the permission of create
for the resource database.backup
to the database user.
Example:
- Backing up a database:
orientdb> CONNECT plocal:../databases/mydatabase admin admin
orientdb> BACKUP DATABASE /backups/mydb.zip
Backing current database to: database mydb.zip
Backup executed in 0.52 seconds
Incremental Backup
Since version 2.2, OrientDB Enterprise Edition supports incremental backups. For more details see Incremental Backup and Restore
For more information, see: