neo4j: 备份和恢复数据

huangapple go评论45阅读模式
英文:

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 &lt;database-name&gt;

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:

Online Backup

Aggregate backup chains

Restore Backup

huangapple
  • 本文由 发表于 2023年5月11日 18:17:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76226546.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定