# Transfer the database from a RoR project to another one

**URL:** <https://www.ruby-forum.com/t/transfer-the-database-from-a-ror-project-to-another-one/144024>\
**Category:** Rails\
**Created:** [July 24, 2008, 6:46pm UTC](https://www.ruby-forum.com/t/transfer-the-database-from-a-ror-project-to-another-one/144024 "2008-07-24T18:46:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![julien51](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/91b2a8/32.png) [@julien51](https://www.ruby-forum.com/u/julien51)\
**Post date:** [July 24, 2008, 6:46pm UTC](https://www.ruby-forum.com/t/transfer-the-database-from-a-ror-project-to-another-one/144024/1 "2008-07-24T18:46:29Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![julien51](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/91b2a8/32.png) [@julien51](https://www.ruby-forum.com/u/julien51)\
**Post date:** [July 24, 2008, 8:22pm UTC](https://www.ruby-forum.com/t/transfer-the-database-from-a-ror-project-to-another-one/144024/2 "2008-07-24T20:22:27Z")

</div>

There’s a plugin called YamlDB ([http://opensource.heroku.com](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-
