Orientdb 简明教程
OrientDB - Upgrading
升级时,必须考虑版本号和格式。有三种类型的格式 - MAJOR(主要)、MINOR(次要)、PATCH(修补)。
While upgrading, you have to consider the version number and the format. There are three types of formats - MAJOR, MINOR, PATCH.
-
MAJOR version entails incompatible API changes.
-
MINOR version entails functionality in a backward-compatible manner.
-
PTCH version entails backward-compatible bug fixes.
要在次要版本和主要版本之间同步,可能需要导出并导入数据库。有时,可能需要将数据库从 LOCAL 迁移到 PLOCAL,并且需要将图迁移到 RidBag。
To synchronize between minor and major versions, you may need to export and import the databases. Sometimes you many need to migrate the database from LOCAL to PLOCAL and need to migrate the graph to RidBag.
Migrate from LOCAL Storage Engine to PLOCAL
从版本 1.5.x 开始,OrientDB 带有一个全新的存储引擎:PLOCAL(分页 LOCAL)。它与 LOCAL 一样持久,但以不同的方式存储信息。以下各点显示了 PLOCAL 和 LOCAL 之间的比较 −
Starting from version 1.5.x OrientDB comes with a brand new storage engine: PLOCAL (Paginated LOCAL). It’s persistent like the LOCAL, but stores information in a different way. Following points show the comparison between PLOCAL and LOCAL −
-
In PLOCAL Records are stored in cluster files, while with LOCAL was split between cluster and data-segments.
-
PLOCAL is more durable than LOCAL because of the append-on-write mode.
-
PLOCAL has minor contention locks on writes, which means more concurrency.
-
PLOCAL doesn’t use Memory Mapping techniques (MMap) so the behavior is more "predictable".
若要将本地存储迁移到新 PLOCAL,需要使用 PLOCAL 作为存储引擎导出并重新导入数据库。以下为步骤。
To migrate your LOCAL storage to the new PLOCAL, you need to export and re-import the database using PLOCAL as storage engine. Following is the procedure.
Step 1 − 打开一个新 shell(Linux/Mac)或命令提示符(Windows)。
Step 1 − Open a new shell (Linux/Mac) or a Command Prompt (Windows).
Step 2 − 使用控制台导出数据库。按照给定命令将数据库 demo 导出到 demo.json.gzip 文件中。
Step 2 − Export the database using the console. Follow the given command to export database demo into demo.json.gzip file.
$ bin/console.sh (or bin/console.bat under Windows)
orientdb> CONNECT DATABASE local:/temp/demo admin admin
orientdb> EXPORT DATABASE /temp/demo.json.gzip
orientdb> DISCONNECT
Step 3 − 在本地文件系统中,使用“plocal”引擎创建新数据库 −
Step 3 − On a local filesystem, create a new database using the "plocal" engine −
orientdb> CREATE DATABASE plocal:/temp/newdb admin admin plocal graph
Step 4 − 将旧数据库导入到新数据库中。
Step 4 − Import the old database to the new one.
orientdb> IMPORT DATABASE /temp/demo.json.gzip -preserveClusterIDs=true
orientdb> QUIT
如果您在相同 JVM 中访问数据库,请务必将 URL 从“local:”更改为“plocal:”
If you access the database in the same JVM, remember to change the URL from "local:" to "plocal:"
Migrate Graph to RidBag
从 OrientDB 1.7 开始,RidBag 是一种默认集合,用于管理图中的邻接关系。虽然由 MVRB-Tree 管理的较旧数据库完全兼容,但您可以将数据库更新为较新的格式。
As of OrientDB 1.7, the RidBag is a default collection that manages adjacency relations in graphs. While the older database managed by an MVRB-Tree are fully compatible, you can update your database to the more recent format.
您可以通过控制台或使用 ORidBagMigration 类来升级图形。
You can upgrade your graph via console or using the ORidBagMigration class.
-
Connect to database CONNECT plocal:databases/<graphdb-name>
-
Run upgrade graph command