How to migrate from Heroku to Amazon Web Services (AWS)

Question:

I have a rails app working on heroku. I wonder how i migrate from Heroku to AWS Elastic Beanstalk.

I use Heroku postgres and I have cron jobs running on working dynos.

I searched on the internet but most links use docker but i need native solution.


EDIT:
I’d better write a few things for people who will read it later.

Firstly, we set the environment variables on elastic beanstalk. Next, we have configured the database.yml file for RDS. You can follow this blog post for these initial setup steps.

sidekiq was the hardest thing that forced us the most in this process.

We created a redis instance with Amazon ElastiCache. Then we changed the redis and sidekiq config settings. In doing this, this blog post was very useful to us in this regard.

Next step is backup our database and restore to RDS. After this step we configured ssl and dns settings.

Meanwhile, if you have the force_ssl config setting in your project, it will cause your project to fail in the newly opened elastic beanstalk environment. Because elastic beanstalk does not have any ssl definition by default.

Answer:

Are you using Heroku postgres? Pull a backup. Restore your backup to an RDS instance (not one started by EBS). You can use AWS services like codebuild, codecommit and pipelines if you want. Otherwise package your repo and upload it to EBS. Set your environment variables in EBS and follow AWS on how to attach your database. If you need a worker you need to make some decisions on how you’ll do it. EBS now has worker tier that you can use but you would have to make some changes to your app.

The more specific you can be about your needs the more we can help.

AWS docs on setting up a rails app on ebs

Leave a Reply