Console - RESTORE DATABASE
Restores a database from a backup. It must be done against a new database. It does not support restores that merge with an existing database. If you need to backup and restore to an existing database, use the EXPORT DATABASE and IMPORT DATABASE commands.
OrientDB Enterprise Edition version 2.2 and major, support incremental backup.
To create a backup file to restore from, use the BACKUP DATABASE command.
Syntax
RESTORE DATABASE <backup-file>|<incremental-backup-directory>
<backup-file>Defines the database file you want to restore.<incremental-backup-directory>Defines the database directory you want to restore from an incremental backup. Available only in OrientDB Enterprise Edition version 2.2 and major.
Permissions:
In order to enable a user to execute this command, you must add the permission of create for the resource database.restore to the database user.
Example of full restore
-
Create a new database to receive the restore:
orientdb>
CREATE DATABASE PLOCAL:/tmp/mydb -
Restore the database from the
mydb.zipbackup file:orientdb {db=/tmp/mydb}>RESTORE DATABASE /backups/mydb.zip
Example of incremental restore
This is available only in OrientDB Enterprise Edition version 2.2 and major.
-
Open a database to receive the restore:
orientdb>
CONNECT PLOCAL:/tmp/mydb -
Restore the database from the
/backupbackup directory:orientdb {db=/tmp/mydb}>RESTORE DATABASE /backup
For more information, see the
BACKUP DATABASE,EXPORT DATABASE,IMPORT DATABASEcommands. For more information on other commands, see Console Commands.