← Back to Blog
Header image for blog post: How to migrate from Heroku: A step-by-step guide
Will Stewart
Published 27th July 2025

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.

What you'll learn

  • 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

Why migrate to Northflank?

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

Who should migrate from Heroku?

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

Before you begin

Prerequisites

  • 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

Concept mapping

Understanding how Heroku concepts map to Northflank will help you plan your migration:

HerokuNorthflankNotes
AppCombined Service or Build + Deployment ServiceSingle or multi-service architecture
DynoInstanceScalable compute units
Dyno TypesResource PlansFlexible CPU/memory configurations
Worker DynoDeployment Service (no public ports)Background processing
SchedulerCron JobTime-based task execution
Config VarsEnvironment Variables / Secret GroupsEnhanced secret management
Heroku PostgresPostgreSQL AddonManaged database with backups
Heroku RedisRedis AddonIn-memory data store
Release PhasePre-deploy CommandDatabase migrations and setup
PipelinePipeline with Release FlowsAdvanced deployment workflows
Review AppsPreview EnvironmentsAutomatic PR deployments

Step 1: Analyze your Heroku setup

Before migrating, document your current Heroku configuration:

List your applications

heroku apps --team YOUR_TEAM

For each application, note:

  1. Process types from your Procfile:
heroku ps --app YOUR_APP_NAME
  1. Configuration variables:
heroku config --app YOUR_APP_NAME
  1. Add-ons and databases:
heroku addons --app YOUR_APP_NAME
  1. Domains:
heroku domains --app YOUR_APP_NAME
  1. Current dyno configuration:
heroku ps:type --app YOUR_APP_NAME

Step 2: Set up Northflank

Connect your Git repository

  1. Log in to your Northflank dashboard
  2. Navigate to your account settings
  3. Connect your Git provider (GitHub, GitLab, or Bitbucket)
  4. Authorize Northflank to access your repositories

Create a project

Projects in Northflank organize your services, databases, and secrets:

  1. Click Create new project in your dashboard
  2. Choose a name and region for your project
  3. Select the region closest to your users for optimal performance

Step 3: Migrate Heroku databases to Northflank

Always migrate databases before applications to ensure your services can connect on first deploy.

For Heroku Postgres → Northflank PostgreSQL

  1. Create a PostgreSQL addon in Northflank:
    • Click Create newAddon
    • 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)
  2. Note the connection details:
    • After creation, go to the Connection details tab
    • Copy the internal connection string for your services

For Heroku Redis → Northflank Redis

  1. Create a Redis addon:
    • Click Create newAddon
    • Select Redis
    • Configure persistence and resources as needed
    • Name it appropriately
  2. Save connection details for later use

Step 4: Create your services

The approach depends on your Procfile complexity:

For single-process applications (web only)

Create a Combined Service that handles both building and deployment:

  1. Click Create newServiceCombined service
  2. 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
  3. 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)
  4. Configure resources:
    • Select CPU and memory based on your current dyno type
    • Set instance count for horizontal scaling

For multi-process applications (web + workers)

Use separate Build and Deployment services for better control:

Create a build service

  1. Click Create newServiceBuild service
  2. Configure your repository and buildpack settings
  3. Add build-time environment variables if needed

Create deployment services

For each process type in your Procfile:

  1. Web process:
    • Create a deployment service
    • Link to your build service
    • Override the start command with your web process command
    • Configure public ports
  2. Worker processes:
    • Create separate deployment services for each worker
    • Override start commands accordingly
    • Don't add public ports (workers are internal only)
  3. 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

Step 5: Migrate Heroku data - Complete database migration guide

Preparation

  1. Scale up your Northflank databases to handle production load
  2. Enable maintenance mode on Heroku:
heroku maintenance:on --app YOUR_APP_NAME

Export from Heroku Postgres

  1. Create a backup:
heroku pg:backups:capture --app YOUR_APP_NAME
  1. Download the backup:
heroku pg:backups:download --app YOUR_APP_NAME

This creates a latest.dump file.

Import to Northflank PostgreSQL

  1. Get your external connection string from the Northflank addon's connection details
  2. 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

Migrate Redis data

For Redis with persistence enabled:

  1. Export from Heroku (if using Redis Cloud or similar):
    • Create a backup through your provider's dashboard
    • Download the RDB file
  2. Import to Northflank:
    • Use redis-cli with both connection strings to migrate

Step 6: Configure advanced features

Configure health checks

Ensure high availability with health checks:

  1. Go to Health checks in your service settings
  2. Configure HTTP endpoints or TCP checks
  3. Set appropriate thresholds and intervals

Set up autoscaling

Unlike Heroku's limited autoscaling, Northflank offers flexible options:

  1. In Resources & scaling, enable autoscaling
  2. Set min/max instances
  3. Configure CPU or memory-based triggers

Step 7: Update DNS and go live

Add custom domains

  1. In your web service, go to Networking
  2. Add your custom domain
  3. Northflank provides DNS records to configure

Update DNS records

  1. Update your domain's DNS to point to Northflank
  2. Northflank automatically provisions TLS certificates
  3. Monitor propagation (usually 5-30 minutes)

Verify and monitor

  1. Test your application thoroughly
  2. Monitor logs in real-time through the Northflank dashboard
  3. Set up alerts for any issues

Post-migration optimization

Leverage Northflank features

  • 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

Cost optimization

  • Review resource usage after a few days
  • Adjust instance sizes based on actual consumption
  • Use Northflank's transparent pricing to optimize costs

Development workflow

  1. Install Northflank CLI:
npm install -g @northflank/cli
  1. Set up local development:
    • Forward services to localhost
    • Execute commands in running containers
    • Manage resources programmatically

Troubleshooting common issues

Build failures

  • Ensure buildpack compatibility (Northflank uses Heroku-20 stack by default)
  • Check build logs for missing dependencies
  • Verify environment variables are set correctly

Database connectivity

  • Use internal URLs for service-to-database connections
  • Ensure services and databases are in the same region
  • Check security settings and connection pooling

Performance differences

  • Northflank containers may have different resource limits
  • Adjust memory and CPU allocation as needed
  • Enable autoscaling for traffic spikes

Next steps

Get help with your Heroku migration

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

💭 FAQs about Heroku migration

How long does it take to migrate from Heroku?

Most teams successfully can migrate Heroku applications in 2-4 hours.

Can I migrate Heroku free tier apps?

Yes, you can easily migrate Heroku free tier applications.

Do I need to change my code to migrate from Heroku?

No code changes required when you migrate Heroku apps using buildpacks.

Share this article with your network
X