Reputation: 1609
I'm migrating a project to Ruby on Rails (which I am new to). This project includes multiples database tables/models/objects that have tens of thousands of records which need to be imported into the new Rails project. The schemas between the old and new projects are similar (all of the same information is present), but not identical. This will be a one-time import of data.
I figure that I need to dump my data into some intermediate format to read into Rails, or write a custom script that talks to both database schemas (probably in PHP since I'm more comfortable with it and the old project is in PHP/Symfony).
My understanding of Rails so far suggests that if I use external tools to insert into my application's MySQL database, everything should still be OK.
Are there any gotchas I should be aware of here? I am particularly concerned about preserving the relationships between records.
Is there is a Best Practice or ready-made tool for what I'm doing that will make this task easier, or me help avoid headaches?
Upvotes: 0
Views: 63
Reputation: 1349
One option is to duplicate the database as-is (maybe with mysqldump
), then use rails migrations to change up any table/column names to fit rails conventions. As a side-benefit, you get some practice with rails migrations =)
Upvotes: 1