Search code examples
databaseorientdb

Why isn't OrientDB EXPORT command maintaining the clusters


I am trying to make an exact copy of an OrientDB database.

So I am exporting the copied database and then creating a new database and importing everything from the export file.

All of the schema and records are correctly imported, but the records in the new database are not in the same clusters as the old database. Instead the records are spread evenly into the class's different clusters.


eg. If I have the dog, dog_1, dog_2, dogs clusters and 8 dog records.

In the old database I'll have

dog = 0 members
dog_1 = 0 members
dog_2 = 0 members
dogs = 8 members

Once I create the new database from the export file the result is:

dog = 2 members
dog_1 = 2 members
dog_2 = 2 members
dogs = 2 members

I am using this command to export the database

EXPORT DATABASE dummyexport.export

I am using this command to create and import the new database

CREATE DATABASE remote:localhost/PleaseWorkDB root 123 plocal
IMPORT DATABASE dummyexport.export.gz -preserveClusterIDs=true

.

Please let me know what I am doing wrong

Thanks!


Solution

  • -preserveClusterIDs is not supported anymore. Your application shouldn't rely on RIDs. They are like persistent pointers, but in case of export/reimport they could change.