尝试使用OrientDB's export/import functionality,但是我一直在从命令行客户端和使用JavaAPI获取错误
使用最少的内容创建数据库,然后调用
export database /tmp/db.export -excludeAll -includeClass="asdf"
然后用
导入import database /tmp/db.export.gz
产生错误消息Invalid format. Found unsupported tag 'brokenRids'
。以下是重现的完整控制台会话:
OrientDB console v.2.2.30 (build 43d850df23c0fd1edca7279761c2238fdc6cc576, branch 2.2.x) https://www.orientdb.com
Type 'help' to display all the supported commands.
orientdb> create database plocal:/var/tmp/databases/test_export_import
Creating database [plocal:/var/tmp/databases/test_export_import] using the storage type [plocal]...Dec 04, 2017 8:57:36 AM com.orientechnologies.common.log.OLogManager log
INFO: Auto configuration of disk cache size.
Dec 04, 2017 8:57:36 AM com.orientechnologies.common.log.OLogManager log
INFO: 2095874048 B/1998 MB/1 GB of physical memory were detected on machine
Dec 04, 2017 8:57:36 AM com.orientechnologies.common.log.OLogManager log
INFO: Soft memory limit for this process is set to -1 B/-1 MB/-1 GB
Dec 04, 2017 8:57:36 AM com.orientechnologies.common.log.OLogManager log
INFO: Hard memory limit for this process is set to -1 B/-1 MB/-1 GB
Dec 04, 2017 8:57:36 AM com.orientechnologies.common.log.OLogManager log
INFO: Path to 'memory' cgroup is '/docker/f88c313794174ac8b8d7ad7d9b5fe396aea8033a1588e7eb6a3f903773081b81'
Dec 04, 2017 8:57:36 AM com.orientechnologies.common.log.OLogManager log
INFO: Mounting path for memory cgroup controller is '/sys/fs/memory'
Dec 04, 2017 8:57:36 AM com.orientechnologies.common.log.OLogManager log
INFO: Can not find '/sys/fs/memory/docker/f88c313794174ac8b8d7ad7d9b5fe396aea8033a1588e7eb6a3f903773081b81' path for memory cgroup, it is supposed that process is running in container, will try to read root '/sys/fs/memory' memory cgroup data
Dec 04, 2017 8:57:36 AM com.orientechnologies.common.log.OLogManager log
INFO: Can not read memory soft limit for cgroup '/sys/fs/memory'
Dec 04, 2017 8:57:36 AM com.orientechnologies.common.log.OLogManager log
INFO: Can not read memory hard limit for cgroup '/sys/fs/memory'
Dec 04, 2017 8:57:36 AM com.orientechnologies.common.log.OLogManager log
INFO: Detected memory limit for current process is 2095874048 B/1998 MB/1 GB
Dec 04, 2017 8:57:36 AM com.orientechnologies.common.log.OLogManager log
INFO: OrientDB auto-config DISKCACHE=444MB (heap=444MB direct=444MB os=1,998MB)
Dec 04, 2017 8:57:36 AM com.orientechnologies.common.log.OLogManager log
INFO: Lowering disk cache size from 444MB to 442MB.
Dec 04, 2017 8:57:36 AM com.orientechnologies.common.log.OLogManager log
INFO: Lowering memory chunk size from 465,567,744B to 463,470,592B.
Dec 04, 2017 8:57:36 AM com.orientechnologies.common.log.OLogManager log
INFO: $ANSI{green {db=test_export_import}} Storage 'plocal:/var/tmp/databases/test_export_import' is created under OrientDB distribution : 2.2.30 (build 43d850df23c0fd1edca7279761c2238fdc6cc576, branch 2.2.x)
Database created successfully.
Current database is: plocal:/var/tmp/databases/test_export_import
orientdb {db=test_export_import}> create class asdf
Class created successfully. Total classes in database now: 11.
orientdb {db=test_export_import}> insert into asdf content {"one": "two", "three": "four"}
Inserted record 'asdf#17:0{one:two,three:four} v1' in 0.009000 sec(s).
orientdb {db=test_export_import}> select from asdf
+----+-----+------+------+------+
|# |@RID |@CLASS|one |three |
+----+-----+------+------+------+
|0 |#17:0|asdf |two |four |
+----+-----+------+------+------+
1 item(s) found. Query executed in 0.005 sec(s).
orientdb {db=test_export_import}> export database /tmp/test_export_import.export -excludeAll -includeClass="asdf"
Exporting current database to: database /tmp/test_export_import.export -excludeAll -includeClass="asdf" in GZipped JSON format ...
Started export of database 'test_export_import' to /tmp/test_export_import.export.gz...
Exporting records...
- Cluster 'internal' (id=0)...OK (records=0/3)
- Cluster 'index' (id=1)...OK (records=0/0)
- Cluster 'manindex' (id=2)...OK (records=0/0)
- Cluster 'default' (id=3)...OK (records=0/0)
- Cluster 'orole' (id=4)...OK (records=0/3)
- Cluster 'ouser' (id=5)...OK (records=0/3)
- Cluster 'ofunction' (id=6)...OK (records=0/0)
- Cluster 'osequence' (id=7)...OK (records=0/0)
- Cluster 'oschedule' (id=8)...OK (records=0/0)
- Cluster 'v' (id=9)...OK (records=0/0)
- Cluster 'v_1' (id=10)...OK (records=0/0)
- Cluster 'v_2' (id=11)...OK (records=0/0)
- Cluster 'v_3' (id=12)...OK (records=0/0)
- Cluster 'e' (id=13)...OK (records=0/0)
- Cluster 'e_1' (id=14)...OK (records=0/0)
- Cluster 'e_2' (id=15)...OK (records=0/0)
- Cluster 'e_3' (id=16)...OK (records=0/0)
- Cluster 'asdf' (id=17)...OK (records=1/1)
- Cluster 'asdf_1' (id=18)...OK (records=0/0)
- Cluster 'asdf_2' (id=19)...OK (records=0/0)
- Cluster 'asdf_3' (id=20)...OK (records=0/0)
Done. Exported 1 of total 10 records. 0 records were detected as broken
Database export completed in 14ms
orientdb {db=test_export_import}> delete from asdf
Delete record(s) '1' in 0.004000 sec(s).
orientdb {db=test_export_import}> import database /tmp/test_export_import.export.gz
Importing database database /tmp/test_export_import.export.gz...
Started import of database 'plocal:/var/tmp/databases/test_export_import' from /tmp/test_export_import.export.gz...
Non merge mode (-merge=false): removing all default non security classes
- Class E was removed.
- Class V was removed.
- Class OTriggered was removed.
- Class ORestricted was removed.
- Class OSchedule was removed.
- Class asdf was removed.
- Class OSequence was removed.
- Class OFunction was removed.
Removed 8 classes.
Importing records...
Started migration of links (-migrateLinks=true). Links are going to be updated according to new RIDs:
- Cluster asdf_3... Completed migration of 0 records in current cluster
- Cluster ouser... Completed migration of 3 records in current cluster
- Cluster asdf_2... Completed migration of 0 records in current cluster
- Cluster asdf_1... Completed migration of 0 records in current cluster
- Cluster default... Completed migration of 0 records in current cluster
- Cluster orole... Completed migration of 3 records in current cluster
- Cluster asdf... Completed migration of 1 records in current cluster
Total links updated: 7
Done. Imported 1 records in 0.05 secs
Error on database import happened just before line 0, column 116
com.orientechnologies.orient.core.db.tool.ODatabaseImportException: Invalid format. Found unsupported tag 'brokenRids'
at com.orientechnologies.orient.core.db.tool.ODatabaseImport.importDatabase(ODatabaseImport.java:189)
at com.orientechnologies.orient.console.OConsoleDatabaseApp.importDatabase(OConsoleDatabaseApp.java:2188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.orientechnologies.common.console.OConsoleApplication.execute(OConsoleApplication.java:405)
at com.orientechnologies.common.console.OConsoleApplication.executeCommands(OConsoleApplication.java:260)
at com.orientechnologies.common.console.OConsoleApplication.run(OConsoleApplication.java:131)
at com.orientechnologies.orient.console.OConsoleDatabaseApp.main(OConsoleDatabaseApp.java:145)
Error: com.orientechnologies.orient.core.db.tool.ODatabaseExportException: Error on importing database 'test_export_import' from file: /tmp/test_export_import.export.gz
Error: com.orientechnologies.orient.core.db.tool.ODatabaseImportException: Invalid format. Found unsupported tag 'brokenRids'
任何帮助都非常感激。
编辑:导出的数据如下所示:
gunzip -c /tmp/test_export_import.export.gz
{"records":[{"@type":"d","@rid":"#17:0","@version":1,"@class":"asdf","one":"two","three":"four"}],"brokenRids":[]}
答案 0 :(得分:0)
这意味着您尝试导入由旧版ODB导出的数据。我们不支持从未来版本到过去版本的兼容性,但当然也支持相反的兼容性。