Exports the current database to a file. OrientDB uses a JSON-based Export Format. By default, it compresses the file using the GZIP algorithm.
IMPORT command, this allows you to migrate the database between different versions of OrientDB without losing data.
If you receive an error about the database version, export the database using the same version of OrientDB that has generated the database.
Bear in mind, exporting a database browses it, rather than locking it. While this does mean that concurrent operations can execute during the export, it also means that you cannot create an exact replica of the database at the point when the command is issued. In the event that you need to create a snapshot, use the
You can restore a database from an export using the
NOTE: While the export format is JSON, there are some constraints in the field order. Editing this file or adjusting its indentation may cause imports to fail.
By default, this command exports the full database. Use its options to disable the parts you don't need to export.
EXPORT DATABASE <output-file> [-excludeAll] [-includeClass=<class-name>*] [-excludeClass=<class-name>*] [-includeCluster=<cluster-name>*] [-excludeCluster=<cluster-name>*] [-includeInfo=<true|false>] [-includeClusterDefinitions=<true|false>] [-includeSchema=<true|false>] [-includeSecurity=<true|false>] [-includeRecords=<true|false>] [-includeIndexDefinitions=<true|false>] [-includeManualIndexes=<true|false>] [-compressionLevel=<0-9>] [-compressionBuffer=<bufferSize>]
<output-file>Defines the path to the output file.
-excludeAllSets the export to exclude everything not otherwise included through command options
-includeClassExport includes certain classes, specifically those defined by a space-separated list.In case you specify multiple class names, you have to wrap the list between quotes, eg.
-includeClass="Foo Bar Baz"
-excludeClassExport excludes certain classes, specifically those defined by a space-separated list.
-includeClusterExport includes certain clusters, specifically those defined by a space-separated list.
-excludeClusterExport excludes certain clusters, specifically those defined by a space-separated list.
-includeInfoDefines whether the export includes database information.
-includeClusterDefinitionsDefines whether the export includes cluster definitions.
-includeSchemaDefines whether the export includes the database schema.
-includeSecurityDefines whether the export includes database security parameters.
-includeRecordsDefines whether the export includes record contents.
-includeIndexDefinitionsDefines whether the export includes the database index definitions.
-includeManualIndexesDefines whether the export includes manual index contents.
-compressionLevelDefines the compression level to use on the export, in a range between
0(no compression) and
9(maximum compression). The default is
1. (Feature introduced in version 1.7.6.)
-compressionBufferDefines the compression buffer size in bytes to use in compression. The default is 16kb. (Feature introduced in version 1.7.6.)
Export the current database, including everything:
EXPORT DATABASE C:\temp\petshop.exportExporting current database to: C:\temp\petshop.export... Exporting database info...OK Exporting dictionary...OK Exporting schema...OK Exporting clusters... - Exporting cluster 'metadata' (records=11) -> ...........OK - Exporting cluster 'index' (records=0) -> OK - Exporting cluster 'default' (records=779) -> OK - Exporting cluster 'csv' (records=1000) -> OK - Exporting cluster 'binary' (records=1001) -> OK - Exporting cluster 'person' (records=7) -> OK - Exporting cluster 'animal' (records=5) -> OK - Exporting cluster 'animalrace' (records=0) -> OK - Exporting cluster 'animaltype' (records=1) -> OK - Exporting cluster 'orderitem' (records=0) -> OK - Exporting cluster 'order' (records=0) -> OK - Exporting cluster 'city' (records=3) -> OK Export of database completed.
Export the current database, including only its functions:
EXPORT DATABASE functions.gz -includeClass=OFunction -includeInfo=FALSE -includeClusterDefinitions=FALSE -includeSchema=FALSE -includeIndexDefinitions=FALSE -includeManualIndexes=FALSE
Alternatively, you can simplify the above by excluding all, then including only those features that you need. For instance, export the current database, including only the schema:
EXPORT DATABASE schema.gz -excludeALL -includeSchema=TRUE
For more information on backups and restores, imports and exports, see the following commands:
as well as the following pages:
For more information on other commands, see Console Commands.