Bob Sanders
2007-Aug-21 22:45 UTC
How do you copy over a development database to production?
I know to copy your development database schema over to your test database uses db:test:prepare. What''s the equivalent command to copy the development database over to the production database? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
nextpulse
2007-Aug-21 23:32 UTC
Re: How do you copy over a development database to production?
Personally, I just export/import the database via sql admin. Much simpler to manage. On Aug 21, 3:45 pm, Bob Sanders <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I know to copy your development database schema over to your test > database uses db:test:prepare. > > What''s the equivalent command to copy the development database over to > the production database? > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
charlie caroff
2007-Aug-22 02:03 UTC
Re: How do you copy over a development database to production?
I use mongrel_rails cluster and apache, and subversion and capistrano. One day soon I will look into doing all this with scripts and / or subversion / capistrano, but for now, this is not too bad: On my production box: remove the production database (I keep backups on the development side, which is where all my changes take place): mysql > drop database projectname_production create a new empty production database, so I can import new sql into it in a moment: mysql > create database projectname_production Then, on development my development box: dump out the entire development database into an sql file: mysqldump -u mysql -p projectname_development > projectname_production.sql copy entire database to production machine on production machine: mongrel_rails cluster::stop apachectl stop mysql -u root -p projectname_production < projectname_production.sql mongrel_rails cluster::start apachectl start That''s what I do -- Charlie nextpulse wrote:> Personally, I just export/import the database via sql admin. Much > simpler to manage. > > On Aug 21, 3:45 pm, Bob Sanders <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > I know to copy your development database schema over to your test > > database uses db:test:prepare. > > > > What''s the equivalent command to copy the development database over to > > the production database? > > -- > > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
raghukumar
2007-Aug-22 15:24 UTC
Re: How do you copy over a development database to production?
Hi Bob, this may be a silly answer, but just putting it across, change your database.yml file entries like: exchange your username, password, database, host etc, in production to test then run the corresponding rake task. (i don''t remember the task, may be "rake clone:db_struture" or "rake test:db:prepare" Note: doing this will copy all your schema but it may not copy the constraints you defined on those database objects. On Aug 22, 7:03 am, charlie caroff <charlie.car...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I use mongrel_rails cluster and apache, and subversion and > capistrano. One day soon I will look into doing all this with scripts > and / or subversion / capistrano, but for now, this is not too bad: > > On my production box: > > remove the production database (I keep backups on the development > side, which is where all my changes take place): > > mysql > drop database projectname_production > > create a new empty production database, so I can import new sql into > it in a moment: > > mysql > create database projectname_production > > Then, on development my development box: > > dump out the entire development database into an sql file: > > mysqldump -u mysql -p projectname_development > > projectname_production.sql > > copy entire database to production machine > > on production machine: > mongrel_rails cluster::stop > apachectl stop > > mysql -u root -p projectname_production < projectname_production.sql > > mongrel_rails cluster::start > apachectl start > > That''s what I do -- > > Charlie > > nextpulse wrote: > > Personally, I just export/import the database via sql admin. Much > > simpler to manage. > > > On Aug 21, 3:45 pm, Bob Sanders <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > wrote: > > > I know to copy your development database schema over to your test > > > database uses db:test:prepare. > > > > What''s the equivalent command to copy the development database over to > > > the production database? > > > -- > > > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Bob Sanders
2007-Aug-23 22:27 UTC
Re: How do you copy over a development database to productio
Charlie and raghukumar, Thank you for your fabulous ideas. I really appreciate it. I just got it set up, and it works great. Thanks a bunch! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---