SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: deployment

  1. #1
    SitePoint Zealot
    Join Date
    Aug 2006
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    deployment

    Hi,

    I am trying to deploy a rails application using Capistrano and Subversion. I have created the repository on the server, then run cap deploy:setup and deploy:cold. It went through without errors, the db:migrations filled the database with the tables and columns. However, I think I missed a couple of steps, because the tables has no content. Apart from trying to do a backup and restore of the database, is there a specific command rake or cap, that will also populate the database on the server with content?

  2. #2
    SitePoint Enthusiast AllTom's Avatar
    Join Date
    Feb 2008
    Location
    Wherever danger lies...
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What content do you want to fill the database with? The data in your fixtures? What you have in your local development database?
    There are some things you shouldn't try to code at home.

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2006
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, what i have on the workstation, I have quite a bit of data, that I don't want to re-enter.

  4. #4
    SitePoint Enthusiast AllTom's Avatar
    Join Date
    Feb 2008
    Location
    Wherever danger lies...
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Export your database to YAML format using one of these articles (or another, if you find one):

    - http://www.realityforge.org/articles...-yaml-fixtures
    - http://snippets.dzone.com/posts/show/2525

    Both of those put the data in the test/fixtures/ directory; move them to db/bootstrap/.* On the server, run:

    Code:
    $ rake db:bootstrap RAILS_ENV=production
    This will wipe the production database and replace the data with that in the YAML files in db/bootstrap/.

    * I say to move them because test/fixtures/ is for fixtures used in your tests, whereas db/bootstrap/ is for bootstrap data.
    There are some things you shouldn't try to code at home.

  5. #5
    SitePoint Zealot
    Join Date
    Aug 2006
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I'll test it and then may try to use it for the future, but I did a backup to a mysql.sql file and then restore it to the production database. It worked but now have another problem which I will put into another thread.

    thanks much for your help


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •