Neo4j版本升级(社区版)

Neo4j版本升级(社区版)

参考:官方手册


前期准备

Neo4j数据库包括单一实例集群,都可以升级,目前只学习单一实例的升级。

升级分类

Neo4j的版本升级其实主要分两种情况:

  • 一是Upgrade(升级));

    打补丁,或者小版本升级

    Neo4j upgrade is the process of upgrading an existing single or clustered deployment to a newer PATCH or MINOR version.

    Neo4j 升级是将现有的单个或集群部署升级到较新的 PATCH 或 MINOR 版本的过程。

    Such upgrades do not require changes to the Neo4j configurations or the applications that use Neo4j. For example, upgrades between:

    此类升级不需要更改 Neo4j 配置或使用 Neo4j 的应用程序:

  • 二是Migration(迁移)

    大版本升级,配置、功能等会有比较大的改动。

    Neo4j migration is the process of migrating an existing single or clustered deployment to a newer MAJOR version. Such migrations require a review of the Neo4j configurations and the applications that use Neo4j. For example, migration between:

    Neo4j 迁移是将现有的单个或集群部署迁移到较新的 MAJOR 版本的过程。这样的迁移需要检查 Neo4j 配置和使用 Neo4j 的应用程序。例如:

    • MAJOR versions, e.g., from 3.5.13 to 4.0.10.

    主要版本,例如,从3.5.13到4.0.10。


升级路线()

主要也有两条路径:

  • 序列路线(白嫖路线)

    按顺序一步一步,一级一级地往更高版本升级,适合社区版

    sequential (Neo4j DBMS) — 3.5.latest → 4.0.latest → 4.1.latest → 4.2.latest → 4.3.latest → 4.4.latest
    It includes migration and follow-up upgrades of the whole Neo4j DBMS (both the databases and system database).

  • 直接路线(氪金路线)

    直接从当前版本升级到更新的指定版本,只能升级到企业版(想走捷径,得加钱。)

    direct migration (Neo4j 3.5 only) — Neo4j Community or Enterprise Edition 3.5.latest → Neo4j Enterprise Edition 4.x.latest
    It makes use of the neo4j-admin copy command to migrate the data store of the single 3.5 database.

下面这个图就比较直观展示了两种路线的些微差别(官方文档后面还有):

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-7pWPPjaq-1653818115207)(https://neo4j.com/docs/upgrade-migration-guide/current/_images/upgrade-paths.svg)]

升级示例

由于社区版即可满足需求,这里只走一下白嫖路线:

我现在的版本是4.0.11,想升级到4.1.

4.0to4.1.

官方手册在此,照着一步步来就可以了:

Follow the checklist to prepare for upgrading your Neo4j deployment:

  1. 确认安装了Jdk11

    因为4.x版本都支持jdk11,此项满足

  2. 检查目标版本的改进和修复。

    可以看看,不看问题也不大。

  3. 备份当前的部署

    Depending on your particular deployment and environment, it is important to design an appropriate backup and restore strategy. For more information about what to consider when deciding on your backup and restore strategy, what needs to be backed up, and the different backup modes and options, see Operations Manual → Backup and restore planning.

    根据您的特定部署和环境,设计适当的备份和恢复策略非常重要。有关在决定备份和恢复策略时需要考虑的内容、需要备份的内容以及不同的备份模式和选项的详细信息,请参阅操作手册→备份和恢复计划。

    虽然官方提供了一系列的备份方法,然,在线备份只有企业版可以,离线备份需要逐个备份数据库。

    由于neo4j不支持降级,完成上述数据库的备份后,我直接把整个<Neo4j-home>压缩备份,后面如果需要,解压后放到合适位置即可回退到之前的4.0版本了。

  4. 准备一个新neo4j.conf 文件

    Prepare a neo4j.conf file to be used by the new installation if you have any custom values configured in your old neo4j.conf file. Look for:

    如果在旧的 neo4j.conf 文件中配置了任何自定义值,则准备一个新安装使用的 neo4j.conf 文件。

  5. 下载并安装新版Neo4j

    Installation - Operations Manual (neo4j.com)

  6. 配置 neo4j.conf 文件

    • 替换conf文件

      Replace the neo4j.conf file with the one that you have prepared in section Prepare a new neo4j.conf file to be used by the new installation.

      用您在本节中准备的文件替换 neo4j.conf 文件,准备一个新的 neo4j.conf 文件供新安装使用。

    • 修改conf参数

      1. Set dbms.allow_upgrade=true to allow automatic store upgrade.

      设置 dbms.allow _ update = true 以允许自动存储升级。

      1. Set dbms.mode=SINGLE. This enables the automatic upgrade of the system database schema, as the setting dbms.allow_single_automatic_upgrade is true by default when dbms.mode=SINGLE.

      设置 dbms.mode = SINGLE。这支持系统数据库模式的自动升级,因为在 dbms.mode = SINGLE 时,默认设置 dbms.allow _ SINGLE _ auto _ update 为 true。

  7. 加密文件配置

    1. Copy all the files used for encryption, such as private key, public certificate, and the contents of the trusted and revoked directories (located in /certificates/).

    复制用于加密的所有文件,例如私钥、公共证书以及受信任和被撤销目录(位于 < neo4j-home >/凭证/中)的内容。

  8. 数据库恢复

    Restore each of your databases and transactions in the new installation, including the system database, by either using neo4j-admin restore (online) or neo4j-admin load (offline), depending on your backup approach. If you are running a Debian/RPM distribution, you can skip this step.

    根据您的备份方法,使用 neo4j-admin 恢复(在线)或 neo4j-admin 加载(离线)恢复新安装中的每个数据库和事务,包括系统数据库。如果您正在运行 Debian/RPM 发行版,您可以跳过这一步。

    社区版只能用离线方法:

    Restore a database dump - Operations Manual (neo4j.com)

  9. 插件恢复

    If using custom plugins, make sure they are updated and compatible with the new version, and place them in the /plugins directory.

    如果使用自定义插件,请确保它们已经更新并与新版本兼容,并将它们放在/plugins 目录中。

over!

(未完待续。。。)

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值