jamesc
jamesc

Reputation: 12837

How to migrate heroku rails app to the same app on new host?

I need to switch my rails app from Heroku to my new host on Linode. I need to address the following concerns and would appreciate some advice

1) How to migrate the data from Heroku to my new Linode host?

2) How to redirect the Heroku domain from myapp.herokuapp.com to my_new_host.com ?

I need to achieve the above as simultaneously as possible so that new data is not lost

Upvotes: 2

Views: 450

Answers (1)

John Beynon
John Beynon

Reputation: 37507

  1. Assuming you're running PostGres on your Linode host then you will simply need to backup your on Heroku and then restore it into Heroku (pgbackups). There are other options - You could use heroku db:pull to pull it down from Heroku into your local database and then transfer than to Linode. Another option would to be use the Heroku gem on your linode server to pull the data directly from the heroku app into the linode database.

  2. You can only redirect on Heroku using code, so you would have to push up an app that does a redirect (rack_rewrite) to your new host.

  3. You'll want to put your application on Heroku into maintenance mode on Heroku. Perform the data transfer via which ever mechanism you choose. Then deploy the 'redirect' code to the Heroku app and then turn maintenance mode off on Heroku. Visitors to the herokuapp.com address will then be redirected to the application running on the new URL wherever that may be.

Upvotes: 3

Related Questions