neo4j迁移数据从4.4版本到5.17版本

1、备份4.4版本的数据

名字要以.dump 结尾, 不然导入不到新的neo4j 数据库中

bash 复制代码
systemctl stop neo4j
neo4j-admin dump --database=neo4j --to=/tmp/neo4j.dump

2.导入数据到5.17版本的neo4j中

1> 把备份文件放到一个目录下,只有备份文件

bash 复制代码
/Users/bailongma/Documents/neo4j.dumpLoad/
/Users/bailongma/Documents/neo4j.dumpLoad/neo4j.dump

2> 恢复数据

bash 复制代码
brew services  stop neo4j
neo4j-admin database load --from-path=/Users/bailongma/Documents/neo4j.dumpLoad/  --overwrite-destination=true neo4j --verbose

最后输出的内容
The loaded database 'neo4j' is not on a supported version (current format: AF4.3.0 introduced in 4.3.0). Use the 'neo4j-admin database migrate' command

3> 安装执行 migrate 加上--force-btree-indexes-to-range

bash 复制代码
neo4j-admin database migrate neo4j --force-btree-indexes-to-range

不加速上--force-btree-indexes-to-range 会包如下错误

bash 复制代码
2024-03-11 02:52:03.317+0000 ERROR [o.n.c.d.MigrateStoreCommand] Failed to migrate database 'neo4j': Migration will remove all BTREE indexes and constraints backed by BTREE indexes. To guard against unintentionally removing indexes or constraints, it is recommended for all BTREE indexes or constraints backed by BTREE indexes to have a valid replacement. Indexes can be replaced by RANGE, TEXT or POINT index and constraints can be replaced by constraints backed by RANGE index. Please drop your indexes and constraints or create replacements and retry the migration. The indexes and constraints without replacement are: [Index( id=9, name='index_9e928bcf', type='BTREE', schema=(:Concept {id}), indexProvider='native-btree-1.0' ), Index( id=8, name='index_9cd40186', type='BTREE', schema=(:Order {orderID}), indexProvider='native-btree-1.0' ), Index( id=7, name='index_22b7066a', type='BTREE', schema=(:Customer {customerID}), indexProvider='native-btree-1.0' ), Index( id=4, name='index_60a51174', type='BTREE', schema=(:Product {productName}), indexProvider='native-btree-1.0' ), Index( id=17, name='index_e8659bba', type='BTREE', schema=(:File {fileName}), indexProvider='native-btree-1.0' ), Index( id=15, name='index_c45ecb68', type='BTREE', schema=(:ArtifactId {fqn}), indexProvider='native-btree-1.0' ), Index( id=16, name='index_2bae0813', type='BTREE', schema=(:Artifact {fqn}), indexProvider='native-btree-1.0' ), Index( id=6, name='index_de8a8b8f', type='BTREE', schema=(:Supplier {supplierID}), indexProvider='native-btree-1.0' ), Index( id=18, name='index_5c88aaa9', type='BTREE', schema=(:Version {fqn}), indexProvider='native-btree-1.0' ), Index( id=5, name='index_44f4e370', type='BTREE', schema=(:Category {categoryID}), indexProvider='native-btree-1.0' ), Index( id=11, name='index_60d85244', type='BTREE', schema=(:GroupId {name}), indexProvider='native-btree-1.0' ), Index( id=10, name='index_1cc3c547', type='BTREE', schema=(:Type {fqn}), indexProvider='native-btree-1.0' ), Index( id=12, name='index_2021f2af', type='BTREE', schema=(:Package {fqn}), indexProvider='native-btree-1.0' ), Index( id=3, name='index_eadfd5a0', type='BTREE', schema=(:Product {productID}), indexProvider='native-btree-1.0' ), Index( id=14, name='index_cadc6548', type='BTREE', schema=(:Repository {url}), indexProvider='native-btree-1.0' ), Index( id=13, name='index_65a8ebac', type='BTREE', schema=(:Project {fqn}), indexProvider='native-btree-1.0' )] and []. Alternatively, you can use the option --force-btree-indexes-to-range to force all BTREE indexes or constraints backed by BTREE indexes to be replaced by RANGE equivalents. Be aware that RANGE indexes are not always the optimal replacement of BTREEs and performance may be affected while the new indexes are populated. See the Neo4j v5 migration guide online for more information.
2024-03-11 02:52:03.318+0000 ERROR [o.n.c.d.MigrateStoreCommand] Migration failed for databases: 'neo4j'
Migration failed for databases: 'neo4j'
Run with '--verbose' for a more detailed error message.

4> 启动数据库

bash 复制代码
brew services  start  neo4j

完成数据迁移

相关推荐
麦麦大数据6 小时前
基于vue+neo4j 的中药方剂知识图谱可视化系统
vue.js·知识图谱·neo4j
engchina12 小时前
Neo4j 和 Python 初学者指南:如何使用可选关系匹配优化 Cypher 查询
数据库·python·neo4j
engchina12 小时前
使用 Cypher 查询语言在 Neo4j 中查找最短路径
数据库·neo4j
engchina2 天前
Neo4j数据库清理指南:如何安全地删除所有节点和索引
数据库·neo4j
麦麦大数据3 天前
vue+django+neo4j航班智能问答知识图谱可视化系统
django·vue·echarts·neo4j·智能问答·ltp·航班
engchina4 天前
docker 启动 neo4j
docker·容器·neo4j
阿梦Anmory6 天前
[neo4j报错]py2neo.errors.ClientError: [Request.Invalid] Not Found解决方案
neo4j
lisacumt7 天前
【neo4j】 neo4j cypher单一语句 optional 可选操作的技巧
neo4j
qa浪涛10 天前
基于知识图谱的教学案例问答系统
人工智能·django·知识图谱·neo4j
qa浪涛11 天前
基于知识图谱的美食推荐系统
人工智能·python·django·知识图谱·neo4j·美食