I have a Ruby on Rails application that has two active environments: Stageand Production. Our development team uses Stage, but we would like to transfer our data to the production server for various reasons. However, the new database has a conflicting identifier, so it is not as simple as pulling data from one place and inserting it into another. For example, let's say we have a table called Widgets:
Widget:
id: 9836
name: "Staging widget"
parent_id: 9635
container_id: 533
If the above data is one of our widgets, we cannot import because there is already a widget with ID 9836and / or there is already a container with ID 533, that is, we will need to scan the association chain to create new containers before placing widgets in them.
We use MySQL databases for both environments. I was thinking about importing, and just adding 10,000 to all the corresponding columns that end in _id, as this will push us beyond the conflicting borders, but this seems like a bad decision.
Are there any tools, projects or ideas that can help me solve this problem?