TransferGraph is small node.js project to transfer data from one GraphQL instance to another.
You must have already migrated your schema to the new GraphQL instance before this will work.
THIS WILL CLOBBER DATA IN THE TARGET GRAPHQL INSTANCE
Before transfering in the data from the old GraphQL instance, it will clear the data in the new instance!
If your database is complicated, feel free to reimplement main.js with manual calls to clearTable()
and transferTableData()
If you want to do a dry run, there is a variable called dryRun you can set to true
(if someone wants to submit a PR to turn this into a cli option, please do)
- back up your data by exporting a .json from every table in the hasura console
- run
npm install
- fill out the
.env-example
- Be VERY careful about getting this right
- Don't mix up the servers, you could destroy your old data
- Don't commit this file, you could leak your admin secrets
- rename
.env-example
to.env
- fill out the
transfer-example.json
while ensuring it is in the right order for your database - rename
transfer-example.json
totransfer.json
- run
npm run transfer