Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 813
mdrozdziel Avatar asked Apr 15 '10 12:04

mdrozdziel


2 Answers

You can use mysql directly:

mysqldump app_development | mysql app_test
like image 121
ndp Avatar answered Oct 22 '22 23:10

ndp


You can use:

rake db:test:clone

To copy the development db into test.

like image 14
Toby Hede Avatar answered Oct 22 '22 22:10

Toby Hede