向后兼容性
OrientDB支持之前版本和最新版本之间二进制(内部数据存储是二进制格式的)的兼容性。二进制的兼容性最少跨2个minor版本。
例如,发布版本1.5, 1.5.1, 1.6.1, 1.6.2, 1.7, 1.7.1之间,至少1.7.1和1.6.1, 1.6.2, 1.7是兼容的。
如果我们有发布版本1.5, 1.5.1, 1.6.1, 1.6.2, 1.7, 1.7.1, 2.0,至少2.0和 1.7, 1.7.1是兼容的。
二进制兼容性的特征遵循如下算法实现:
- When storage is opened, version of binary format which is used when storage is created is read from storage configuration.
- Factory of objects are used to present disk based data structures for current binary format is created.
Only features and database components which were exist at the moment when current binary format was latest one will be used. It means that you can not use all database features available in latest release if you use storage which was created using old binary format version. It also means that bugs which are fixed in new versions may be (but may be not) reproducible on storage created using old binary format.
To update binary format storage to latest one you should export database in JSON format and import it back.
Using either console commands export database and import database or Java API look at com.orientechnologies.orient.core.db.tool.ODatabaseImport
, com.orientechnologies.orient.core.db.tool.ODatabaseExport
classes and com.orientechnologies.orient.test.database.auto.DbImportExportTest
test.
- Current binary format version can be read from
com.orientechnologies.orient.core.db.record.OCurrentStorageComponentsFactory#binaryFormatVersion
proporty. - Instance of
OCurrentStorageComponentsFactory
class can be retrieved by call ofcom.orientechnologies.orient.core.storage.OStorage#getComponentsFactory
method. - Latest binary format version can be read from here
com.orientechnologies.orient.core.config.OStorageConfiguration#CURRENT_BINARY_FORMAT_VERSION
.
Please note that binary compatibility is supported since 1.7-rc2 version for plocal storage (as exception you can read database created in 1.5.1 version by 1.7-rc2 version).
Return to Upgrade.