Console Command Import - aemadrid/orientdb GitHub Wiki

Console command: import database

Import database

Import a database to the current one opened. The input file is in JSON format using the Export-Format generated by Console Command Export tool. By default the file is compressed using the GZIP algorithm. The Export/Import commands allow to migrate between engine releases without loosing data.

Use the Export command to generate the JSON file to import.

Syntax

    import database <input-file>

Where:

  • input-file Input file path

Example

> import database C:/temp/petshop.export
Importing records...
- Imported records into the cluster 'internal': 5 records
- Imported records into the cluster 'index': 4 records
- Imported records into the cluster 'default': 1022 records
- Imported records into the cluster 'orole': 3 records
- Imported records into the cluster 'ouser': 3 records
- Imported records into the cluster 'csv': 100 records
- Imported records into the cluster 'binary': 101 records
- Imported records into the cluster 'account': 1005 records
- Imported records into the cluster 'company': 9 records
- Imported records into the cluster 'profile': 9 records
- Imported records into the cluster 'whiz': 1000 records
- Imported records into the cluster 'address': 164 records
- Imported records into the cluster 'city': 55 records
- Imported records into the cluster 'country': 55 records
- Imported records into the cluster 'animalrace': 3 records
- Imported records into the cluster 'ographvertex': 102 records
- Imported records into the cluster 'ographedge': 101 records
- Imported records into the cluster 'graphcar': 1 records

Troubleshooting

If during the importing you experience that "Imported cluster 'XXX' has id=6 different from the original: 5" means that your database was created with an ancient version of OrientDB:

- Creating cluster 'company'...Error on database import happened just before line 16, column 52
com.orientechnologies.orient.core.exception.OConfigurationException: Imported cluster 'company' has id=6 different from the original: 5
        at com.orientechnologies.orient.core.db.tool.ODatabaseImport.importClusters(ODatabaseImport.java:500)
        at com.orientechnologies.orient.core.db.tool.ODatabaseImport.importDatabase(ODatabaseImport.java:121)

To fix it just drop the ORIDs class before to import the database:

orientdb> drop class ORIDs
orientdb> import database ...

This is a command of the Orient console. To know all the commands go to Console-Commands.

⚠️ **GitHub.com Fallback** ⚠️