Skip to content

Migrating from meteor.sh

Kevin Kaland edited this page Jun 3, 2014 · 2 revisions

As long as you are on an Ubuntu 12.04+ system, migrating from netmute/meteor.sh is pretty straightforward.

Steps

  1. Configure mup.json and settings.json according to the README.

  2. SSH into your server. You should deploy your app to a test server or virtual machine using meteor.sh first so that your production app doesn't have unnecessary downtime if something goes wrong. Run these steps against that one first, and then against production. You will need a little bit of production downtime (because you have to reinstall MongoDB), but probably not more than a few minutes.

  3. Back up your current MongoDB database. The following command will probably work (if you are not running on the default port or meteor.sh database name, then also use --host and/or change the argument to --db)

     mongodump --db meteorapp --out /path/to/backup/folder
    
  4. Stop your app.

     forever logs # Find the one with main.js, probably 0 or 1
     forever stop <number> # where <number> is the number that is your app
    

    You can also just pkill forever, but I recommend stopping just to let MongoDB calm down and not get into a state where you have to repair it.

  5. SSH in to server, and run the following with sudo or as root:

     apt-get remote mongodb mongodb-clients
    

    Don't worry, you won't lose any data.

  6. Set up the server for Meteor-UP. mup setup

  7. Deploy the application using Meteor-UP. mup deploy

  8. Your app should now be running. I encountered the MongoDB needing repair once, but I'll leave that explanation to the documentation. Just make sure you run --repair as the mongodb user if you need to, or chown -R the files in the MongoDB directory (I think it's /var/lib/mongodb) back to that user after repairing them!

  9. You've now migrated to Meteor-UP, and your settings and environment variables have become much easier to manage. You can even commit them into a private repository since the Meteor-UP directory lives outside of your application! Happy deploying!