Migrating production systems requires careful planning. This guide outlines the steps to move your Heroku-hosted application and PostgreSQL database to Hatchbox, ensuring a smooth transition.


1. Connect Your Git Repository to Hatchbox

click “Repositories” in the Hatchbox dashboard and select “Add Repository” to connect your GitHub repository.

hatchbox https://www.hatchbox.io/announcements/38


2. Create Databases on Hatchbox


3. Configure Production DATABASE_URL

default: &default
  adapter: postgresql
  encoding: unicode
  pool: <%= ENV.fetch("RAILS_MAX_THREADS", 5) %>
development:
  <<: *default
  database: yourapp_development
test:
  <<: *default
  database: yourapp_test
production:
  <<: *default
  url: <%= ENV["DATABASE_URL"] %>

4. Copy Environment Variables

heroku config --json > herokuenv.json

Open the file and remove/update any unnecessary variables:


4. Copy PostgreSQL Data

https://blair.biz/heroku-pg-hatchbox/


5. Migrate Scheduled Tasks (Cron Jobs)


6. Additional Considerations


Conclusion

Migrating from Heroku to Hatchbox involves syncing your code, replicating your database, transferring environment configurations, and setting up scheduled tasks. Follow these steps carefully, and always perform thorough testing before going live. This methodical approach will help ensure a seamless transition for your production application.