Neo4j - 数据库备份和恢复

Posted Circle-C

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Neo4j - 数据库备份和恢复相关的知识,希望对你有一定的参考价值。

neo4j-admin 工具支持在线/离线备份,在线备份需要收费。本章主要介绍离线版

备份

1、在对Neo4j数据进行备份、还原、迁移的操作时,首先要关闭neo4j

./bin/neo4j stop

2、数据备份到文件

./bin/neo4j-admin dump --database=graph.db --to=/root/soul_20221003.dump

还原

1、还原、迁移之前 ,关闭neo4j服务。操作同上

./bin/neo4j-admin load --from=/root/soul_20221003.dump --database=graph.db

2、重启服务

./bin/neo4j start

如果启动后没有数据,检查配置项:

将dbms.allow_upgrade设为true

2022-10-03 03:12:25.709+0000 INFO  Starting...
2022-10-03 03:12:26.867+0000 INFO  This instance is ServerId7b5227aa (7b5227aa-aadf-4c99-8ee1-3720204ff61f)
2022-10-03 03:12:29.991+0000 INFO  ======== Neo4j 4.4.11 ========
2022-10-03 03:12:33.142+0000 INFO  Performing postInitialization step for component 'security-users' with version 3 and status CURRENT
2022-10-03 03:12:33.143+0000 INFO  Updating the initial password in component 'security-users'
2022-10-03 03:12:33.201+0000 ERROR [soul/44aadfa1] Error upgrading database. Database left intact and will likely not be able to start: org.neo4j.storageengine.migration.UpgradeNotAllowedException: Neo4j cannot be started because the database files require upgrading and upgrades are disabled in the configuration. Please set 'dbms.allow_upgrade' to 'true' in your configuration file and try again. Detailed description: Upgrade is required to migrate store to new major version.
2022-10-03 03:12:33.298+0000 INFO  Bolt enabled on [0:0:0:0:0:0:0:0%0]:7687.
2022-10-03 03:12:35.200+0000 INFO  Remote interface available at http://localhost:7474/


 

以上是关于Neo4j - 数据库备份和恢复的主要内容,如果未能解决你的问题,请参考以下文章

Neo4j - 数据库备份和恢复

Neo4j数据进行备份还原

无法使用 neo4j-backup 备份 Neo4J 数据库

neo4j 社区版在线备份

centos7 下Neo4j 安装配置备份

neo4j简介