4.x 版本中支持的升级和迁移路径
本节介绍支持的升级和迁移路径。
您选择的路径取决于您当前的数据库版本和目标版本;取决于您是要升级或迁移整个 Neo4j DBMS 还是单个数据库;以及您的备份和还原策略。
-
顺序路径 (Neo4j DBMS) 从 3.5.latest → 4.0.latest → 4.1.latest → 4.2.latest → 4.3.latest → 4.4.latest
它包括整个 Neo4j DBMS(数据库和system数据库)的迁移和后续升级。 -
复制/迁移单个数据库 从 Neo4j Community 或 Enterprise Edition 3.5.latest 或 4.x 到 Neo4j Enterprise Edition 4.4.latest
它利用neo4j-admin copy命令来迁移单个数据库的数据存储 (data store)。neo4j-admin copy命令是 Neo4j Enterprise Edition 的功能。您可以使用它从 Neo4j Community Edition 迁移到 Neo4j Enterprise Edition。 -
还原单个数据库 到较新版本的运行中 Neo4j DBMS。
顺序路径 (Neo4j DBMS)
遵循顺序路径时,您首先将 Neo4j 部署从 3.5.latest 迁移到 4.0.latest,然后依次升级到 4.1.latest、4.2.latest、4.3.latest 和 4.4.latest。它利用 neo4j-admin load 或 neo4j-admin restore 将数据库和 system 数据库或备份复制到新安装中,然后在 Neo4j 启动期间将数据和模式 (schema) 存储升级到新版本。neo4j-admin 命令可以在在线或离线状态的 Neo4j DBMS 上运行,并且必须以 neo4j 用户身份调用,以确保具备适当的文件权限。
| 起始版本 | 目标版本 | 支持的路径 | 操作 | 文档 |
|---|---|---|---|---|
3.4.latest |
3.5.latest |
3.4.latest → 3.5.latest |
升级 |
|
3.5.latest |
4.0.latest |
3.5.latest → 4.0.latest |
迁移 |
|
3.5.latest |
4.1.latest |
3.5.latest → 4.0.latest → 4.1.latest |
迁移和升级 |
|
3.5.latest |
4.2.latest |
3.5.latest → 4.0.latest → 4.1.latest → 4.2.latest |
迁移和升级 |
|
3.5.latest |
4.3.latest |
3.5.latest → 4.0.latest → 4.1.latest → 4.2.latest → 4.3.latest |
迁移和升级 |
|
3.5.latest |
4.4.latest |
3.5.latest → 4.0.latest → 4.1.latest → 4.2.latest → 4.3.latest → 4.4.latest |
迁移和升级 |
|
4.0.latest |
4.1.latest |
4.0.latest → 4.1.latest |
升级 |
|
4.0.latest |
4.2.latest |
4.0.latest → 4.1.latest → 4.2.latest |
升级 |
|
4.0.latest |
4.3.latest |
4.0.latest → 4.1.latest → 4.2.latest → 4.3.latest |
升级 |
|
4.0.latest |
4.4.latest |
4.0.latest → 4.1.latest → 4.2.latest → 4.3.latest → 4.4.latest |
升级 |
|
4.1.latest |
4.2.latest |
4.1.latest → 4.2.latest |
升级 |
|
4.1.latest |
4.3.latest |
4.1.latest → 4.2.latest → 4.3.latest |
升级 |
|
4.1.latest |
4.4.latest |
4.1.latest → 4.2.latest → 4.3.latest → 4.4.latest |
升级 |
|
4.2.latest |
4.3.latest |
4.2.latest → 4.3.latest |
升级 |
|
4.2.latest |
4.4.latest |
4.2.latest → 4.3.latest → 4.4.latest |
升级 |
|
4.3.latest |
4.4.latest |
4.3.latest → 4.4.latest |
升级 |
复制/迁移单个数据库
您可以使用 neo4j-admin copy 命令将单个数据库(system 数据库除外)复制或迁移到运行中任意较新版本的 Neo4j DBMS。copy 命令会复制并根据需要迁移数据库的数据存储。但是,它不会复制模式存储 (schema store)。因此,如果定义了模式,您必须手动运行 neo4j-admin copy 操作输出的命令来重新创建模式。
此路径适用于:
-
清理数据库不一致和压缩存储。
-
将单个数据库从 3.5 Neo4j DBMS(Community 或 Enterprise)迁移到 4.x Enterprise。
-
迁移单个数据库的存储格式。有关存储格式版本和兼容性的更多信息,请参阅 操作手册 → 存储格式和实体限制。
-
将单个数据库从 4.x Community Edition 迁移到 4.y Enterprise Edition。
-
将单个数据库从 4.x Enterprise Edition 迁移到较新的 4.y Enterprise Edition。
-
将单个数据库从 4.x Enterprise Edition 迁移到具有不同存储格式的较新 4.y Enterprise Edition。
|
请记住, |
有关更多信息,请参阅 教程:在运行中的单个实例中备份和复制单个数据库 和 教程:在运行中的集群中备份和复制单个数据库。
还原单个数据库
您可以使用 neo4j-admin restore 命令将单个数据库的备份还原到运行中较新版本的 Neo4j DBMS。但是,它不会迁移数据库的存储格式 (store_format)。因此,如果还原的数据库存储格式与 DBMS 不一致,您必须设置 dbms.allow_upgrade=true 来启用迁移。对于 4.1 之前的版本,您必须重启 DBMS 才能使配置生效。
有关更多信息,请参阅 教程:在单个实例中备份和还原单个数据库 和 教程:在集群中备份和还原单个数据库。