- OrientDB Tutorial
- OrientDB - Home
- OrientDB - Overview
- OrientDB - Installation
- OrientDB - Basic Concepts
- OrientDB - Data Types
- OrientDB - Console Modes
- OrientDB Database Commands
- OrientDB - Create Database
- OrientDB - Alter Database
- OrientDB - Backup Database
- OrientDB - Restore Database
- OrientDB - Connect Database
- OrientDB - Disconnect Database
- OrientDB - Info Database
- OrientDB - List Database
- OrientDB - Freeze Database
- OrientDB - Release Database
- OrientDB - Config Database
- OrientDB - Export Database
- OrientDB - Import Database
- OrientDB - Commit Database
- OrientDB - Rollback Database
- OrientDB - Optimize Database
- OrientDB - Drop Database
- OrientDB Record Commands
- OrientDB - Insert Record
- OrientDB - Display Records
- OrientDB - Load Record
- OrientDB - Reload Record
- OrientDB - Export Record
- OrientDB - Update Record
- OrientDB - Truncate Record
- OrientDB - Delete Record
- OrientDB Class Commands
- OrientDB - Create Class
- OrientDB - Alter Class
- OrientDB - Truncate Class
- OrientDB - Drop Class
- OrientDB Cluster Commands
- OrientDB - Create Cluster
- OrientDB - Alter Cluster
- OrientDB - Truncate Cluster
- OrientDB - Drop Cluster
- OrientDB Property Commands
- OrientDB - Create Property
- OrientDB - Alter Property
- OrientDB - Drop Property
- OrientDB Vertex Commands
- OrientDB - Create Vertex
- OrientDB - Move Vertex
- OrientDB - Delete Vertex
- OrientDB Edge Commands
- OrientDB - Create Edge
- OrientDB - Update Edge
- OrientDB - Delete Edge
- OrientDB Advanced Concepts
- OrientDB - Functions
- OrientDB - Sequences
- OrientDB - Indexes
- OrientDB - Transactions
- OrientDB - Hooks
- OrientDB - Caching
- OrientDB - Logging
- OrientDB - Performance Tuning
- OrientDB - Upgrading
- OrientDB - Security
- OrientDB - Studio
- OrientDB Interfaces
- OrientDB - Java Interface
- OrientDB - Python Interface
- OrientDB Useful Resources
- OrientDB - Quick Guide
- OrientDB - Useful Resources
- OrientDB - Discussion
OrientDB - Backup Database
Like RDBMS, OrientDB also supports the backup and restore operations. While executing the backup operation, it will take all files of the current database into a compressed zip format using the ZIP algorithm. This feature (Backup) can be availed automatically by enabling the Automatic-Backup server plugin.
Taking backup of a database or exporting a database is the same, however, based on the procedure we have to know when to use backup and when to use export.
While taking backup, it will create a consistent copy of a database, all further write operations are locked and waiting to finish the backup process. In this operation, it will create a read-only backup file.
If you need the concurrent read and write operation while taking a backup you have to choose exporting a database instead of taking backup of a database. Export doesn’t lock the database and allows concurrent writes during the export process.
The following statement is the basic syntax of database backup.
./backup.sh <dburl> <user> <password> <destination> [<type>]
Following are the details about the options in the above syntax.
<dburl> − The database URL where the database is located either in the local or in the remote location.
<user> − Specifies the username to run the backup.
<password> − Provides the password for the particular user.
<destination> − Destination file location stating where to store the backup zip file.
<type> − Optional backup type. It has either of the two options.
Default − locks the database during the backup.
LVM − uses LVM copy-on-write snapshot in background.
Example
Take a backup of the database demo which is located in the local file system /opt/orientdb/databases/demo into a file named sample-demo.zip and located into the current directory.
You can use the following command to take a backup of the database demo.
$ backup.sh plocal: opt/orientdb/database/demo admin admin ./backup-demo.zip
Using Console
The same you can do using the OrientDB console. Before taking the backup of a particular database, you have to first connect to the database. You can use the following command to connect to the database named demo.
orientdb> CONNECT PLOCAL:/opt/orientdb/databases/demo admin admin
After connecting you can use the following command to take backup of the database into a file named ‘backup-demo.zip’ in the current directory.
orientdb {db=demo}> BACKUP DATABASE ./backup-demo.zip
If this command is executed successfully, you will get some success notifications along with following message.
Backup executed in 0.30 seconds
To Continue Learning Please Login
Login with Google