Tuesday, March 1, 2011

Rails - Populate test database with development data

Is there any trivial way to copy the data from developmenet database into the test one? I know theres a way to copy schema and recreate database, but is there any rake task to populate test database with development one?

From stackoverflow
  • You can use:

    rake db:test:clone
    

    To copy the development db into test.

    mdrozdziel : Doesn't work for me at all. Structure is created, but no records are copied. Is that task ment to copy the data at all? The description isn't pointing that directly.
  • You can use mysql directly:

    mysqldump app_development | mysql app_test
    

0 comments:

Post a Comment