Blog

Migrate from Heroku to Engine Yard AppCloud

By | March 17th, 2011 at 9:03AM

Before arriving to work at Engine Yard I ran a Rails consultancy called Mocra. We would deploy our draft Rails apps on Heroku and then migrate them to Engine Yard AppCloud or perhaps a small VPS at some stage. I still have over 30 little apps on Heroku, I think. Back when I was at Mocra, I would have loved a migration tool to help us migrate an initial Heroku app to a production environment like Engine Yard AppCloud. Migrating an application and its data is kind of a pain.

Fortunately I had a couple weeks at home recently after the birth of my third child, so I finally had the time to create the tool I always wanted – a migration tool to onboard on to Engine Yard AppCloud from other places, called ey-migrate.

Source – https://github.com/engineyard/engineyard-migrate

ey-migrate heroku .

First up, in the spirit of my own personal need: let’s all migrate Heroku applications to AppCloud.

The tool assumes you have:

  • A running Heroku application with your data in its SQL database
  • A Gemfile, rather than Heroku’s deprecated .gems format
  • Added mysql2 to your Gemfile
  • This upgraded application running on AppCloud without any of your data

Need to create your AppCloud account? Sign up now.

Done all that? Let’s do the migration dance.

Run the following command and your database is automatically migrated across:

gem install engineyard-migrate
ey-migrate heroku .

The command line application ey-migrate should tell you what to do if you’ve missed a step – like forgetting to boot your AppCloud environment or forgetting to deploy your application after the environment boots.

If you run into any difficulties at all with the migration tool, or have a wish list of features, drop them into the issues tracker.

What’s next?

I’d like to be able to migrate some configuration (delayed job and cron job settings), and other databases (mongodb). What else would be great for a migration tool?

I also want the migration tool to migrate _from_ AppCloud _to_ AppCloud. There are occasions when you need to create a new environment and boot it from scratch, and then migrate your application over (for example, migrating the application to a new region via the Multi-Region Alpha feature). I’d like a tool for that.

  • http://twitter.com/_itsmatthew matthew sedlacek

    This is huge… Exactly how my web shop works as well. Thanks guys!

  • http://drnicwilliams.com drnic

    Awesome! I’m glad we weren’t completely insane when we ran Mocra :)

  • http://drnicwilliams.com drnic

    If you use any of the add-ons and would like automation around their migration, drop some tickets in the issues tracker.

  • http://www.facebook.com/people/Carl-Farnsworth/100000568480519 Carl Farnsworth

    Really cool! But…

    Perhaps adding in a migrate assistant hides the fact that Engine Yard needs a cheaper ‘staging’ or ‘development’ environment. At over $150 for your developer setup I think lots of developers will follow this same workflow.

  • http://drnicwilliams.com drnic

    Hey Carl, I think the cheapest option for staging is a small solo (the default solo is a medium) which you can access via the custom configuration. We don’t recommend the small instances for production Rails applications – historically they have been underpowered. But for staging, they are probably fine. It might be a interesting idea to offer a “Small Staging Solo” configuration if you’ve set your framework to anything but “production”. I’ll mention it to the team.

    Currently I don’t have any comparison mechanism in the tool, mostly because you have to set up your AppCloud account and boot your cluster up front and THEN run the migration tool. So by the time you use the migration tool you’ve already seen the pricing etc.

    If/when the migration tool can perform more account/environment operations itself, then it would make a lot of sense to display pricing information.

    Thoughts?

    Nic

  • http://www.facebook.com/peter.boling Peter Boling

    “let’s all migrate Heroku applications to AppCloud.”

    Nice try, Engine Yard… :)

  • http://drnicwilliams.com drnic

    I do try :) I’ll try to do a demo video for those who didn’t follow along at home.

  • http://www.facebook.com/ciccotosto Max Ciccotosto

    We actually just migrated all our stuff from Heroku to EY. What a relief! Let us know if you need case studies!

  • https://profiles.google.com/janson Mike Janson

    How strong is the dependency on MySQL? Is the process fairly straightforward if we want to migrate to an EY instance with PostgreSQL?

  • http://drnicwilliams.com drnic

    If you are using any specific postgresql queries, then I recommend you using a postgresql DB (https://github.com/damm/ey-postgresql9) instead of the mysql db you are given with each AppCloud application. If you have a vanilla Rails application then switching from postgresql to mysql should be fine.

    One edge case is that I am using heroku’s own heroku command line, and the taps gem, to pull down your heroku database. I believe it may drop some schema information. If using “heroku db:pull” to your local database works perfectly, then this migration tool will work perfectly for you too.

  • Some dude

    Some developers still can’t use a simple calculator or do the math themselves I guess. It’s ~$80/mo if you want to ‘develop’ or ‘stage’ on EngineYard with a small solo instance running 24/7.

    If you don’t run 30days @ 24/7 for staging, then it’ll be even cheaper as you only pay for the hours you use.