I used rails to create next version of my application. My old app was using php and mysql. Also in new application I changed the database schema. So right now I have data with old schema and I want to migrate this data to rails application. What is the best way to re generate this data in proper way. Also I have a lot of connections and I changed the way they work
Share
You have to define some temporary models to work with the old database, along with models for the new database schema. By connecting to two databases, read from one and write to other, you can migrate the data from old database to new database. Here and here is some help on how to connect to two databases in one rails application. Then you can write a script to run with rails runner which will load one model from old database and dump it into new database or a rake task which would do that.