

How to migrate from Heroku: A step-by-step guide
Whether you're looking to migrate Heroku applications due to pricing changes, seeking better performance, or need more flexibility, this guide covers everything you need to successfully migrate from Heroku to Northflank.
- How Heroku concepts translate to Northflank's architecture
- Step-by-step migration of your applications and databases
- Best practices for zero-downtime migration
- How to leverage Northflank's advanced features post-migration
Northflank offers a modern alternative to Heroku with transparent pricing, better performance, and more flexibility:
- Cost-effective: Pay only for resources you use with no hidden fees
- Global deployment: Deploy to multiple regions worldwide
- Advanced networking: Built-in private networking, multiple ports, and protocol support
- Superior developer experience: Modern UI, comprehensive API, and CLI tools
- No vendor lock-in: Build with Dockerfiles or buildpacks, your choice
- Better performance: Migrate Heroku apps to modern infrastructure
This Heroku migration guide is perfect for:
- Teams looking to migrate Heroku apps to reduce costs
- Developers needing to migrate Heroku databases with too much fuss
- Companies planning to migrate from Heroku's limited regions to global infrastructure
- Anyone seeking to migrate Heroku worker dynos to a more flexible platform
- A Northflank account
- Access to your Heroku applications and databases
- Your application code in a Git repository (GitHub, GitLab, or Bitbucket)
- Heroku CLI installed for data export
Understanding how Heroku concepts map to Northflank will help you plan your migration:
Heroku | Northflank | Notes |
---|---|---|
App | Combined Service or Build + Deployment Service | Single or multi-service architecture |
Dyno | Instance | Scalable compute units |
Dyno Types | Resource Plans | Flexible CPU/memory configurations |
Worker Dyno | Deployment Service (no public ports) | Background processing |
Scheduler | Cron Job | Time-based task execution |
Config Vars | Environment Variables / Secret Groups | Enhanced secret management |
Heroku Postgres | PostgreSQL Addon | Managed database with backups |
Heroku Redis | Redis Addon | In-memory data store |
Release Phase | Pre-deploy Command | Database migrations and setup |
Pipeline | Pipeline with Release Flows | Advanced deployment workflows |
Review Apps | Preview Environments | Automatic PR deployments |
Before migrating, document your current Heroku configuration:
heroku apps --team YOUR_TEAM
- Process types from your Procfile:
heroku ps --app YOUR_APP_NAME
- Configuration variables:
heroku config --app YOUR_APP_NAME
- Add-ons and databases:
heroku addons --app YOUR_APP_NAME
- Domains:
heroku domains --app YOUR_APP_NAME
- Current dyno configuration:
heroku ps:type --app YOUR_APP_NAME
- Log in to your Northflank dashboard
- Navigate to your account settings
- Connect your Git provider (GitHub, GitLab, or Bitbucket)
- Authorize Northflank to access your repositories
Projects in Northflank organize your services, databases, and secrets:
- Click Create new project in your dashboard
- Choose a name and region for your project
- Select the region closest to your users for optimal performance
Always migrate databases before applications to ensure your services can connect on first deploy.
- Create a PostgreSQL addon in Northflank:
- Click Create new → Addon
- Select PostgreSQL
- Choose your version (match your Heroku version if possible)
- Select resources based on your current usage
- Name it descriptively (e.g.,
production-db
)
- Note the connection details:
- After creation, go to the Connection details tab
- Copy the internal connection string for your services
- Create a Redis addon:
- Click Create new → Addon
- Select Redis
- Configure persistence and resources as needed
- Name it appropriately
- Save connection details for later use
The approach depends on your Procfile complexity:
Create a Combined Service that handles both building and deployment:
- Click Create new → Service → Combined service
- Configure build settings:
- Select your Git repository and branch
- Choose Buildpack as the build type
- Northflank auto-detects your buildpack, or you can specify custom ones
- Add any required build arguments
- Set runtime configuration:
- Add all environment variables from your Heroku config
- Replace database URLs with Northflank connection strings
- Configure ports (Northflank auto-detects for buildpacks)
- Configure resources:
- Select CPU and memory based on your current dyno type
- Set instance count for horizontal scaling
Use separate Build and Deployment services for better control:
- Click Create new → Service → Build service
- Configure your repository and buildpack settings
- Add build-time environment variables if needed
For each process type in your Procfile:
- Web process:
- Create a deployment service
- Link to your build service
- Override the start command with your web process command
- Configure public ports
- Worker processes:
- Create separate deployment services for each worker
- Override start commands accordingly
- Don't add public ports (workers are internal only)
- Use Secret Groups for shared configuration:
- Create a secret group with common environment variables
- Link it to all your deployment services
- Override service-specific variables as needed
- Scale up your Northflank databases to handle production load
- Enable maintenance mode on Heroku:
heroku maintenance:on --app YOUR_APP_NAME
- Create a backup:
heroku pg:backups:capture --app YOUR_APP_NAME
- Download the backup:
heroku pg:backups:download --app YOUR_APP_NAME
This creates a latest.dump
file.
- Get your external connection string from the Northflank addon's connection details
- Restore the backup:
pg_restore --verbose --no-acl --no-owner \
-d "YOUR_NORTHFLANK_EXTERNAL_CONNECTION_STRING" \
latest.dump
For large databases (>20GB), use parallel jobs:
pg_restore --verbose --no-acl --no-owner --jobs=4 \
-d "YOUR_NORTHFLANK_EXTERNAL_CONNECTION_STRING" \
latest.dump
For Redis with persistence enabled:
- Export from Heroku (if using Redis Cloud or similar):
- Create a backup through your provider's dashboard
- Download the RDB file
- Import to Northflank:
- Use
redis-cli
with both connection strings to migrate
- Use
Ensure high availability with health checks:
- Go to Health checks in your service settings
- Configure HTTP endpoints or TCP checks
- Set appropriate thresholds and intervals
Unlike Heroku's limited autoscaling, Northflank offers flexible options:
- In Resources & scaling, enable autoscaling
- Set min/max instances
- Configure CPU or memory-based triggers
- In your web service, go to Networking
- Add your custom domain
- Northflank provides DNS records to configure
- Update your domain's DNS to point to Northflank
- Northflank automatically provisions TLS certificates
- Monitor propagation (usually 5-30 minutes)
- Test your application thoroughly
- Monitor logs in real-time through the Northflank dashboard
- Set up alerts for any issues
- Private networking: Services communicate internally without internet exposure
- Multiple ports: Run multiple services on different ports
- Persistent volumes: Attach storage for stateful applications
- Advanced pipelines: Create sophisticated deployment workflows
- Review resource usage after a few days
- Adjust instance sizes based on actual consumption
- Use Northflank's transparent pricing to optimize costs
- Install Northflank CLI:
npm install -g @northflank/cli
- Set up local development:
- Forward services to localhost
- Execute commands in running containers
- Manage resources programmatically
- Ensure buildpack compatibility (Northflank uses Heroku-20 stack by default)
- Check build logs for missing dependencies
- Verify environment variables are set correctly
- Use internal URLs for service-to-database connections
- Ensure services and databases are in the same region
- Check security settings and connection pooling
- Northflank containers may have different resource limits
- Adjust memory and CPU allocation as needed
- Enable autoscaling for traffic spikes
- Explore Northflank's API for automation
- Set up CI/CD pipelines
- Configure backup schedules for databases
Our team has helped hundreds of companies migrate Heroku apps. We can provide migration support for complex applications. Contact support through your dashboard for assistance with:
- Large database migrations
- Complex application architectures
- Enterprise migration planning
- Performance optimization
Most teams successfully can migrate Heroku applications in 2-4 hours.
Yes, you can easily migrate Heroku free tier applications.
No code changes required when you migrate Heroku apps using buildpacks.