簡體   English   中英

無法還原OrientDB備份

[英]Can't restore OrientDB Backup

我無法從備份還原OrientDB數據庫。 我使用的是OrientDB 1.2.0版(此備份來自2012年11月),該備份是由OrientDB(相同版本)使用內置備份實用程序生成的。 我正在嘗試使用OrientDB控制台將備份還原到新數據庫:

create database remote:localhost/dbname root password local graph
import database backup.json

但是,當我運行這些命令時,在控制台中出現以下錯誤:

Importing indexes ...
- Index 'dictionary'...Error on database import happened just before line 22258, column 6
com.orientechnologies.orient.core.exception.OConcurrentModificationException: Cannot update record #0:1 in storage 'dbname' because the version is not the latest. Probably you are updating an old record or it has been modified by another user (db=v2 your=v1)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException(OChannelBinary.java:429)
    at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.handleStatus(OChannelBinary.java:382)
    at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:145)
    at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:59)
    at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:1556)
    at com.orientechnologies.orient.client.remote.OStorageRemote.command(OStorageRemote.java:727)
    at com.orientechnologies.orient.client.remote.OStorageRemoteThread.command(OStorageRemoteThread.java:191)
    at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:60)
    at com.orientechnologies.orient.core.index.OIndexManagerRemote.dropIndex(OIndexManagerRemote.java:80)
    at com.orientechnologies.orient.core.index.OIndexManagerProxy.dropIndex(OIndexManagerProxy.java:80)
    at com.orientechnologies.orient.core.db.tool.ODatabaseImport.importIndexes(ODatabaseImport.java:687)
    at com.orientechnologies.orient.core.db.tool.ODatabaseImport.importDatabase(ODatabaseImport.java:127)
    at com.orientechnologies.orient.console.OConsoleDatabaseApp.importDatabase(OConsoleDatabaseApp.java:1419)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.orientechnologies.common.console.OConsoleApplication.execute(OConsoleApplication.java:238)
    at com.orientechnologies.common.console.OConsoleApplication.executeCommands(OConsoleApplication.java:127)
    at com.orientechnologies.common.console.OConsoleApplication.run(OConsoleApplication.java:92)
    at com.orientechnologies.orient.console.OConsoleDatabaseApp.main(OConsoleDatabaseApp.java:130)

所有記錄均正確導入,但在索引上失敗。 我有15個以上同一數據庫的備份,而且它們都有這個問題,因此似乎它們都沒有損壞。 如何還原數據庫? (如果需要,我可以不必修改JSON。)


當嘗試使用本地模式而不是遠程模式時,出現另一個錯誤:

Started import of database 'local:dbname' from dbname.json...
Importing database info...OK
Importing clusters...
- Creating cluster 'internal'...OK, assigned id=0
- Creating cluster 'default'...Error on database import happened just before line 13, column 52
com.orientechnologies.orient.core.exception.OConfigurationException: Imported cluster 'default' has id=3 different from the original: 2. To continue the import drop the cluster 'manindex' that has 1 records
    at com.orientechnologies.orient.core.db.tool.ODatabaseImport.importClusters(ODatabaseImport.java:544)
    at com.orientechnologies.orient.core.db.tool.ODatabaseImport.importDatabase(ODatabaseImport.java:130)
    at com.orientechnologies.orient.console.OConsoleDatabaseApp.importDatabase(OConsoleDatabaseApp.java:1414)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.orientechnologies.common.console.OConsoleApplication.execute(OConsoleApplication.java:269)
    at com.orientechnologies.common.console.OConsoleApplication.executeCommands(OConsoleApplication.java:157)
    at com.orientechnologies.common.console.OConsoleApplication.run(OConsoleApplication.java:97)
    at com.orientechnologies.orient.graph.console.OGremlinConsole.main(OGremlinConsole.java:53)

Error: com.orientechnologies.orient.core.db.tool.ODatabaseExportException: Error on importing database 'dbname' from file: dbname.json
Error: com.orientechnologies.orient.core.exception.OConfigurationException: Imported cluster 'default' has id=3 different from the original: 2. To continue the import drop the cluster 'manindex' that has 1 records

看來問題在於我的舊群集ID與新數據庫中的ID不匹配。 也許有一些創建選項會影響默認情況下創建的集群?

事實證明,問題在於該數據庫是使用OrientDB 1.2.0版導入的,但是是使用1.0.1(或1.0.0)創建的。 JSON文件將1.2.0版列為engine-version ,但這是備份它而不是創建它的引擎。 在嘗試了Lvca關於使用本地模式的建議之后,我發現群集ID不匹配。 從那里我猜測版本號可能不正確。 因此,即使我使用1.2.0服務器和1.2.0 Java庫運行數據庫,該數據庫也從未被“升級”為使用新的1.2.0模式。

感謝Lvca向正確的方向推進。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM