Has anyone present solved the concept of data repl...
# orm-help
a
Has anyone present solved the concept of data replication across prisma.io stages? I have a production stage,
prod
, and a staging stage
staging
. There is content created in the production service that I occasionally need to troubleshoot in the staging branch (user/admin created content). Typically I would set up a recurring job to run the export in mysql, and import on the other side. I could probably do the same here, but I'm debating between running the commands against the aurora database directly vs a
prisma export
flow, and wondering if anyone has any good resources related to the concept.
My concern with prisma export is that there doesn't seem to be a good way to specify only certain data types, which kind of makes sense with graphql connected nodes. I don't think there would be any issues with just emptying and replacing the entire staging database with the content of the production database every 6 hours or so, but that seems like a situation that could cause unforseen issues down the line.
Also it looks like if I do a regular
prisma export
prisma import
on that database, IDs will be constantly changing, which could cause some issues with my application, where filenames are generated based on IDs
I'd also like to at some point expand this system so that development machines get access to a current set of production data, and that sounds like a whole new world of difficult.
n
IDs will be constantly changing
that's not correct, ids will be preserved
what suggestions for improvement do you have?
a
Honestly I think I have all the tools, just need to do it. It's too specialized a case to say that there should be some way of copying a stage to another stage. However, an automated flow for initializing a prisma database with an NDF zip/file instead of a seed.graphql file would be pretty good, then my devs could have a script to grab the latest copy of the NDF and initialize their development machines with that, since we depend on them being able to troubleshoot with down to the hour customer data
Even there I think I can just bash script prisma import and do most of what I'm looking for.