
Migrating a Rails App from Heroku to Railway
Last weekend I migrated my Doctors App from Heroku to Railway. It's a multi-tenant Rails app where each hospital gets its own subdomain — one.doctors.com , two.doctors.com , and so on. Five hospitals, around 25,000 appointments, 9,700+ patients. Not huge, but not trivial either. Here's how it went, including the part where I accidentally broke the database. The setup I already had a Railway project running with a test domain ( *.juanvasquez.dev ) from earlier experiments. The web service was deployed from GitHub and the Postgres 17 instance was co-located in us-east4 . Cloudflare R2 handles file storage — that stays the same regardless of where the app runs. The plan was simple: put Heroku in maintenance mode, dump the database, restore it to Railway, flip the DNS, and go home. The database restore First, I captured a fresh Heroku backup and downloaded it: heroku pg:backups:capture --app doctors heroku pg:backups:download --app doctors --output /tmp/heroku_backup.dump Then I wiped the
Continue reading on Dev.to
Opens in a new tab


