Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] 数据迁移功能 #706

Open
johnmai-dev opened this issue Oct 16, 2024 · 3 comments
Open

[Feature Request] 数据迁移功能 #706

johnmai-dev opened this issue Oct 16, 2024 · 3 comments

Comments

@johnmai-dev
Copy link

johnmai-dev commented Oct 16, 2024

Is your feature request related to a problem? Please describe.

目前,Tugraph缺乏友好的数据迁移功能,后台提供的导出的JSON和CSV文件无法反向导入。
image

Describe the solution you'd like

  1. 实现子图之间的迁移功能
  2. 支持跨Tugraph的迁移
  3. 部分节点和边的迁移,通过指定Cypher查询数据并导出,再导入到指定子图中

希望能实现类似Navicat的数据迁移工具。

image

@johnmai-dev johnmai-dev changed the title 数据迁移功能 [Feature Request] 数据迁移功能 Oct 16, 2024
@ljcui
Copy link
Collaborator

ljcui commented Oct 21, 2024

比较通用灵活的做法:写python脚本,用cypher语句读数据,数据写到csv文件;然后再用python脚本读csv文件,用cypher语句批量插入数据,写入到新的子图或者新的实例。

@zhangwh807
Copy link
Collaborator

上述的第1,2两个可以使用CALL db.importor.fullFileImportor("${新的图项目名称}",".mdb文件",false)语句

参数说明:
● 第一个参数是新子图名称。这个子图如果已经存在,那么该子图的数据会替换为第二个参数填写的.mdb文件对应的图的数据。如果子图不存在会生成一个新子图。
● 第二个参数是服务器上的文件绝对路径,服务器上要有这个文件才行,这个是db的数据存储文件
● 第三个是文件是否是远程文件,如果是服务器的本地文件就设置为false或者不设置也行
示例:
CALL db.importor.fullFileImportor("test","/var/lib/lgraph/data/EF1AF796FA251C1C8C9F67793D33FF17/data.mdb",false)

注:数据储存在容器内/var/lib/lgraph/data路径下,该路径下一个长字符串的目录存储一个图项目的数据,进入到具体的代表每个图的长字符串目录下有.mdb文件,该文件是具体的模型和数据文件

Copy link

Hello @johnmai-dev. Please provide more info for debugging. Issues labeled by more info needed will be closed if no activities in 7 days.

你好 @johnmai-dev, 我们需要你提供更多信息以便于排查问题。7 天内未跟进此 issue 将会被自动关闭。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants