Transfer the database from a RoR project to another one

Hi,

I am currently working on a version 2 of an existing RoR.
Actually, the first version was so bad that we had to rewrite almost
everyhting, including many models. Nevertheless, we now need to
“migrate” the data from the first application to the second one.

Do you have any strategy for this? Should we just “export” the database
of the first app and load in the second app… knowing that there is a
risk that some of the data we export doesn’t respect the constraints in
the second app?

is it “smart” to export JSON or XML from the first app (through
ActiveRecord) and then re-import everything in the second app through
ActiveRecord? If so, how to do that when the tables are pretty big
(several hundred thousands of records in some tables…)

Thanks for your replies!

There’s a plugin called YamlDB (http://opensource.heroku.com) which
can serialize the entire contents of the database into a .yml file.
However, if your database has large tables, this solution might not be
the best, as the resulting yaml file could be extremely large.
Otherwise, your best bet might be the traditional means of dumping and
loading SQL (mysqldump, etc.).

On Jul 24, 11:46 am, Julien Genestoux <rails-mailing-l…@andreas-

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs