Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using rake to dump and load database

How can I specify a directory for dumping/loading my db to yaml?

rake db:data:dump_dir

created

db/2011-08-31_14:10:57_+0100/

and

rake db:data:load_dir

No such file or directory - <RAILS_ROOT>/db/base

My question is whether you can specify a directory name to dump to/load from and how?

thanks

like image 447
Viktor Trón Avatar asked Aug 31 '11 13:08

Viktor Trón


1 Answers

You can use the 'dir' parameter, eg:

rake db:data:dump_dir dir="my_dir"

which will put it in 'db/my_dir' and:

rake db:data:load_dir dir='my_dir'

which will load it from 'db/my_dir'.

For dumping the directory must NOT exist. In both cases dirs are relative to db, absolute paths are NOT allowed

Hope this helps.

like image 117
Benoit Garret Avatar answered Sep 28 '22 02:09

Benoit Garret