I had a Rails app running for a year. Now I want to overhaul its database so that it can run the new features in my app which I will push to Heroku soon. Rather than create migrations that add, delete, and modify columns and table names, I want to create a new database and move the old data into it.
As I don’t know databases too much, my idea is:
- Download the important tables as csv from the old database
- Create a new database schema in the new app
- Make the csv match the new schema
- Delete the live old database
- Push the new app to heroku
- Seed the tables into the new database
- Hope everything works
Is this a good idea?
I see that it is possible to ‘attach’ a database from app 1 to app 2. Should I create the new database in another app and seed the data there, then attach and promote it to the original app so that the original database will be kept and can be re-attached if anything wrong happens?