Best way to populate development database

What would be the best way to populate a development database for a
Rails 3 app? I have looked at faker, but it seems that development has
stopped, any other options?

Do you have your app deployed? What I do is populate development with
a recent backup of my live server every once in a while. That way I’m
seeing what the users are (at least until it drifts).

How do you do it? Regular sql dump tool (like mysqldump) and then some
rake
task for importing it on the development database?

obviously :smiley:
I was just thinking that could reuse configuration in your database.yml
(for
credentials, database location, etc)

My app is not live yet so I will need some sort of random data
generator for this.

no rake task needed. if you have the mysqldump, use the following
(assuming
the dump is dump.sql)

mysql -u root -p database < dump.sql

On Tue, Feb 8, 2011 at 2:03 PM, Nikos Dimitrakopoulos
[email protected]wrote:

What would be the best way to populate a development database for a
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

You can check the machinist gem
(https://github.com/notahat/machinist/tree/1.0-maintenance) with Sham
(https://github.com/panthomakos/sham) and company. Be aware though that
it’s
pretty slow for big amounts of data (one database write per record)

How about faker and populator? See:

http://railscasts.com/episodes/126-populating-a-database

Steve

Thanks everyone, I went with faker and this rake file:

https://gist.github.com/300536

On 7 February 2011 22:51, Hesham [email protected] wrote:

What would be the best way to populate a development database for a
Rails 3 app? I have looked at faker, but it seems that development has
stopped, any other options?

If you wish to do it via code you can put stuff in db/seeds.rb then run
it via
rake db:seed

Colin

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