英文:
neo4j: backup and restore data
问题
I have a single node neo4j instance(redhat OS based VM) running. Any easier way to backup data and export it to neo4j instance running in another VM?
我有一个运行在红帽操作系统虚拟机上的单节点neo4j实例。有没有更简单的方法来备份数据并将其导出到运行在另一个虚拟机上的neo4j实例?
I tried zipping the data/database/neo4j folder on source VM and unzipping it on destination VM. But, getting errors while starting neo4j.
我尝试在源虚拟机上压缩data/database/neo4j文件夹,然后在目标虚拟机上解压缩它。但是,在启动neo4j时出现错误。
java.lang.RuntimeException: Mismatching store id. Store StoreId: StoreId{creationTime=1676271868772, randomId=5465786452791406693, storeVersion=3471768636287762695, upgradeTime=1676271868772, upgradeTxId=1}. Transaction log StoreId: StoreId{creationTime=1683789569809, randomId=-7569579037412136217, storeVersion=3471768636287762695, upgradeTime=1683789569809, upgradeTxId=1}
java.lang.RuntimeException: 存储标识不匹配。存储标识:StoreId{creationTime=1676271868772, randomId=5465786452791406693, storeVersion=3471768636287762695, upgradeTime=1676271868772, upgradeTxId=1}。事务日志存储标识:StoreId{creationTime=1683789569809, randomId=-7569579037412136217, storeVersion=3471768636287762695, upgradeTime=1683789569809, upgradeTxId=1}
Any thoughts/other approaches are welcome!
欢迎提出任何想法/其他方法!
英文:
I have a single node neo4j instance(redhat OS based VM) running.
Any easier way to backup data and export it to neo4j instance running in another VM?
I tried zipping the data/database/neo4j folder on source VM and unzipping it on destination VM. But, getting errors while starting neo4j.
> java.lang.RuntimeException: Mismatching store id. Store StoreId:
> StoreId{creationTime=1676271868772, randomId=5465786452791406693,
> storeVersion=3471768636287762695, upgradeTime=1676271868772,
> upgradeTxId=1}. Transaction log StoreId:
> StoreId{creationTime=1683789569809, randomId=-7569579037412136217,
> storeVersion=3471768636287762695, upgradeTime=1683789569809,
> upgradeTxId=1}
Any thoughts/other approaches are welcome!
答案1
得分: 1
你可以使用neo4j-admin
命令行界面的dump
命令。在运行此命令之前,请确保你的数据库处于离线状态。命令如下:
neo4j-admin database dump <数据库名称>
这将创建一个<数据库名称>.dump文件,保存在由设置server.directories.dumps.root
指定的文件夹中。
要了解更多选项,请参考此文档。
类似地,你可以使用命令neo4j-admin database load
来还原这个dump。这里是load命令的文档。
另外,如果你想在数据库在线时备份数据,可以使用命令neo4j-admin database backup
。该命令会生成一堆文件,被称为artifacts
,你可以使用命令neo4j-admin database aggregate-backup
将这些文件合并为一个单一的artifact文件。要还原这些artifact文件,请使用命令neo4j-admin database restore
。
参考这些文档:
英文:
You can use the dump
command of the neo4j-admin
command-line interface. Make sure that your database is offline before running this command. The command is like this:
neo4j-admin database dump <database-name>
This will create a <database-name>.dump file. This will be created in the folder pointed by the setting server.directories.dumps.root
.
For more options, you can refer to this documentation.
Similarly, you restore this dump using the command neo4j-admin database load
. Here's the documentation for the load command.
Alternatively, if you want to back up the data while it is online, use the command neo4j-admin database backup
. This command generates a bunch of files known as artifacts
, which can be combined to form one single artifact file using the command neo4j-admin database aggregate-backup
. To restore these artifacts files use the command neo4j-admin database restore
.
Refer to these documentations:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论