Skip Navigation
Heroku Dev Center Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
Heroku Dev Center Dev Center
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
    • .NET
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
  • Log in or Sign up
Show nav
View categories

Categories

  • Heroku Architecture
    • Compute (Dynos)
      • Dyno Management
      • Dyno Concepts
      • Dyno Behavior
      • Dyno Reference
      • Dyno Troubleshooting
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
    • Buildpacks
  • Developer Tools
    • AI Tools
    • Command Line
    • Heroku VS Code Extension
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery & Integration (Heroku Flow)
    • Continuous Integration
  • Language Support
    • .NET
      • Working with .NET
    • Clojure
    • Front-end
    • Go
      • Go Dependency Management
    • Java
      • Java Behavior in Heroku
      • Working with Java
      • Working with Maven
      • Working with Spring Boot
      • Troubleshooting Java Apps
    • Node.js
      • Troubleshooting Node.js Apps
      • Node.js Behavior in Heroku
      • Working with Node.js
    • PHP
      • PHP Behavior in Heroku
      • Working with PHP
    • Python
      • Working with Python
      • Background Jobs in Python
      • Python Behavior in Heroku
      • Working with Django
    • Ruby
      • Rails Support
        • Working with Rails
      • Working with Bundler
      • Working with Ruby
      • Ruby Behavior in Heroku
      • Troubleshooting Ruby Apps
    • Scala
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
      • Heroku Postgres Advanced
      • Migrating to Heroku Postgres
    • Heroku Key-Value Store
    • Apache Kafka on Heroku
    • Other Data Stores
  • AI
    • Inference Essentials
    • Inference API
    • Inference Quick Start Guides
    • AI Models
    • Tool Use
    • AI Integrations
    • Vector Database
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
      • Single Sign-on (SSO)
    • Private Spaces
      • Infrastructure Networking
    • Compliance
  • Heroku Enterprise
    • Enterprise Accounts
    • Enterprise Teams
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
    • Heroku AppLink
      • Getting Started with Heroku AppLink
      • Working with Heroku AppLink
      • Heroku AppLink Reference
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Other Salesforce Integrations
  • Databases & Data Management
  • Heroku Postgres
  • Heroku Postgres Advanced
  • Migrating to Heroku Postgres Advanced

Migrating to Heroku Postgres Advanced

Table of Contents [expand]

  • Considerations
  • Migration Methods
  • Manage Database Migrations
  • Step-by-Step Migration
  • Troubleshooting
  • Limitations
  • Additional Reading

Last updated November 12, 2026

Heroku Postgres Advanced is the newest Heroku Postgres database tier on new and improved infrastructure, and offers flexible customization options to fit your database needs. Advanced databases are on different infrastructure than classic Standard, Premium, Private, and Shield-tier databases. This article walks through how to migrate from a classic Postgres database to an Advanced database.

To test your migration from a classic Heroku Postgres plan to Heroku Postgres Advanced, see Testing Heroku Postgres Advanced Migrations.

You must be on Heroku CLI v11.13.0 or later to use this feature. Update the CLI version with heroku update.

 

If you’re new to Heroku Postgres Advanced, get started with our tutorial Getting Started with Heroku Postgres Advanced.

 

To change plans between Essential and classic Postgres database tiers, see Changing the Plan or Infrastructure of a Heroku Postgres Database.

Considerations

  • The migration requires some downtime on the source database you’re migrating. The length of downtime depends on the size of your database.
  • The migration doesn’t recreate follower databases automatically. Before migrating, configure follower pools on your Advanced database and prepare your app to use them. Or, you can automatically fall back to use the leader pool.
  • Some features on classic Postgres aren’t supported on Advanced databases when you migrate. See the feature parity table on what features Advanced databases don’t support.
  • You can upgrade your Postgres version as part of the migration by creating a destination Advanced database on a higher Postgres version than your source. You can upgrade up to three major versions in a single migration.
  • After your migration completes, you must promote the destination database and re-attach the custom credentials in your Advanced database to the apps where you use them. The migration process doesn’t automatically update your app’s attachments from your classic database to the Advanced database.

Migration Methods

Heroku supports the snapshot method for migrating a classic Heroku Postgres database to an Advanced database.

Method Description
Snapshot Copies all the data from your source database to the destination database.

Use this method for smaller databases or when a maintenance window is acceptable.

Requires downtime of up to several hours, depending on the size of your database.

Snapshot Migration

The snapshot migration copies the data from your source database to the destination database.

When you run the migration, Heroku restricts access to your source database while the full data copy migration completes. The source database can be offline for several hours during the migration, depending on its size.

A snapshot migration migration has these statuses:

Status Description
Creating destination database Heroku is provisioning the destination Advanced database.
Preparing data migration Heroku is setting up migration tooling.
Checking source database Heroku is verifying source database compatibility.
Migration is ready. Check your email for details. The migration is prepared. You have 24 hours to start the migration before it expires.
Copying data The data copy is in progress. Access to your source database is restricted.
Validating migrated data Heroku is validating the copied data. Access to your source database is restricted.
Finalizing data migration Heroku is finalizing the data copy. Access to your source database is restricted.
Cleaning up migration resources Heroku is cleaning up migration infrastructure. Access to your source database is restricted.
Promoting The data copy succeeded. Heroku is finalizing the migration. Access to your source database is restricted.
Migration completed successfully. Check your email for details. The migration completed successfully.
Canceling migration. Wait for the cancellation to finish before starting a new migration. The migration is canceling.
Migration canceled The migration was canceled. Your source database is available.
Migration failed. Check your email for details. The migration encountered an error. Your source database is available.

Manage Database Migrations

Check the Details of a Migration

Run heroku data:pg:migrate to see the status and details of all configured migrations for an app. The command lists each migration with its source database, destination database, migration method, and status. Select Refresh from the interactive prompts to reload the status.

For a description of each status for a snapshot migration, see Snapshot Migration.

Start a Migration

After you configure a migration, you can start running it when its status shows Migration is ready. Check your email for details.. Make sure your app is in maintenance mode and no dynos are writing to the source database before starting.

If you don’t start the migration within 24 hours of the preparation completing, Heroku automatically cancels it, deprovisions the destination database, and restores source database connections. You receive a Migration failed email indicating that the migration timed out, with instructions to retry.

See Step 3: Run the Migration on Your Database for details on starting a migration via the heroku data:pg:migrate interactive prompts.

Cancel a Migration

You can cancel a migration at any point before it begins promoting. If the migration was running, canceling restores connections to your source database and brings it back online. If you didn’t start the migration, canceling has no impact on your source database.

To cancel a migration:

  1. Run heroku data:pg:migrate.

  2. Select Manage migration from ... for the migration to manage.

    $ heroku data:pg:migrate -a example-app
    
    ...
    
    ? What do you want to do? (Use arrow keys)
    ❯ Manage migration from ⛁ postgresql-clean-29349 to ⛁ postgresql-circular-11223
      Configure a new database migration
      ──────────────
      Refresh
      Exit
    
  3. Select Cancel from the migration details.

    === Migration Details
    
    
    Source:        ⛁ postgresql-clean-29349 (DATABASE) - Postgres 18.6 - Available
    Destination:   ⛁ postgresql-circular-11223 (HEROKU_POSTGRESQL_BLUE) - Postgres 18.4 - Migrating
    Method:        Snapshot
    Configured at: 2026-11-03 15:41 UTC
    Status:        Migration is ready. Check your email for details.
    
    
    ? What do you want to do?
      Refresh
      Start
      ❯ Cancel
      ──────────────
      Go back
    
  4. Select Confirm to cancel the migration.

    After canceling, you must create a new migration configuration and wait for the migration tooling to finish preparing to
    migrate ⛁ postgresql-clean-29349 again.
    
    
    ? Confirm to cancel migration: (Use arrow keys)
    ❯ Confirm
      Go back
    

Step-by-Step Migration

The steps to migrate a classic database to an Advanced database are:

  1. Prepare and select the migration method
  2. Enter maintenance mode
  3. Start the migration
  4. Promote your database
  5. Exit maintenance mode
  6. Destroy your old classic database

You can migrate your classic Postgres database to an existing Advanced database, or create an Advanced database as the migration destination database directly during the migration process. See Choosing the Right Heroku Postgres Plan for which Advanced plan level fits the database size of the source database you’re migrating.

Step 1: Prepare the Migration on Your Database

Start the migration process by running the heroku:data:pg:migrate command and follow the interactive prompts to configure the source and destination databases.

This command prepares the migration process from a source classic database to an Advanced database. The preparation step runs various checks to make sure that your database schema and configuration are compatible with the migration process. You receive an email when the setup process is complete and your database is ready to migrate. If your database doesn’t pass the checks, you receive an email with the error details. You must resolve the errors and prepare a new migration.

Your source database remains available while Heroku sets up the necessary tooling for the migration. After setting up the migration tooling, you have 24 hours to begin the migration. The migration puts your database offline until it’s complete.

To start the migration preparation, run heroku data:pg:migrate:

  1. Select Configure a database migration, then Select the source database, and select the classic Postgres database to migrate from.

    $ heroku data:pg:migrate -a example-app
    
    Migrate existing classic Heroku Postgres databases to Advanced databases
    Press Ctrl+C to cancel
    
    === Configured Migrations
    
    You haven't configured any migrations for ⬢ example-app yet.
    
    ? What do you want to do? (Use arrow keys)
      Configure a new database migration
      ──────────────
    ❯ Refresh
      Exit
    
    ? Select the source database: (Use arrow keys)
    ❯ ⛁ postgresql-clean-29349 v18.6 as DATABASE as DATABASE
      ──────────────
      Go back
    
    
  2. Next, select an existing destination Postgres Advanced database to migrate to, or create an Advanced database from the migration interactive prompts.

    Preparing the migration deletes all the content on the destination database. Make sure to select an empty Advanced database to migrate to, or create an Advanced database.

    ? Select the destination database: (Use arrow keys)
    ❯ ⛁postgresql-circular-11223 v18.4 as HEROKU_POSTGRESQL_BLUE
      ──────────────
      Create a new Advanced database
      Go back
    
    
  3. Select the method to use for your database migration:

    Migration Methods:
    · Snapshot: Copies the data from the source database to the destination database.
      Requires downtime on the source database depending on the size.
      Best for smaller databases or when a maintenance window is acceptable.
    
    ? Select the migration method: (Use arrow keys)
    ❯ Snapshot
      ──────────────
      Go back
    
  4. Then, select Confirm to configure the migration:

    By continuing, we prepare the necessary steps for the migration.
    Your source database is available while we prepare the migration.
    You'll receive an email when the preparation is complete or if there's an error.
    You have 24 hours to begin the migration after the preparation is complete.
    Your source database will be unavailable during the migration.
    Preparing the migration deletes all the data on the destination database ⛁ postgresql-circular-11223.
    
    ? Confirm migration configuration: (Use arrow keys)
    > Confirm
      Go back
    
    ? Confirm migration configuration: Confirm
    
    Configuring migration... done
    === Migration Details
    
    Source:        ⛁ postgresql-clean-29349 (DATABASE) - Postgres 18.6 - Available
    Destination:   ⛁ postgresql-circular-11223 (HEROKU_POSTGRESQL_BLUE) - Postgres 18.4 - Available
    Method:        Snapshot
    Configured at: 2026-11-03 15:41 UTC
    Status:        Preparing
    
    ...
    

Run heroku:data:pg:migrate to check the status of the migration preparation. It can take around 30 minutes to prepare a migration.

Step 2: Enter Maintenance Mode

When the migration preparation is complete, you receive an email that your database is ready to migrate. You can also run heroku data:pg:migrate and check that the status shows Migration is ready. Check your email for details.:

heroku data:pg:migrate -a example-app

Migrate an existing classic Postgres database to an Advanced database
Press Ctrl+C to cancel

=== Configured Migrations

  Source Database             Destination Database           Method     Status
 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⛁ postgresql-clean-29349   ⛁ postgresql-circular-11223    Snapshot   Migration is ready. Check your email for details.

Before starting the migration, put your app into maintenance mode or read-only mode so you don’t write to the source database when the migration is complete:

$ heroku maintenance:on -a example-app
Enabling maintenance mode for ⬢ example-app... done

Maintenance mode doesn’t automatically scale down dynos. Scale down web and any non-web dynos (for example, heroku ps:scale worker=0) to make sure that no connections are writing data to the database.

 

If you use Heroku Connect, pause your connection before starting the migration so it can safely switch to your Advanced database after promotion.

Step 3: Run the Migration on Your Database

To start the migration, run the heroku data:pg:migrate command, select the migration to manage from the list, and select Start from the migration actions:

$ heroku data:pg:migrate -a example-app

=== Configured Migrations

  Source Database             Destination Database            Status
 ───────────────────────────────────────────────────────────────────────
  ⛁ postgresql-clean-29349   ⛁ postgresql-circular-11223   Ready

? What do you want to do? (Use arrow keys)
❯ Manage migration from ⛁ postgresql-clean-29349 to ⛁ postgresql-circular-11223
  Configure a new database migration
  ──────────────
  Refresh
  Exit

? What do you want to do? Manage migration from ⛁ postgresql-clean-29349 to ⛁ postgresql-circular-11223

=== Migration Details

Source:        ⛁ postgresql-clean-29349 (DATABASE) - Postgres 18.6 - Available
Destination:   ⛁ postgresql-circular-11223 (HEROKU_POSTGRESQL_BLUE) - Postgres 18.4 - Migrating
Method:        Snapshot
Configured at: 2026-11-03 15:41 UTC
Status:        Migration is ready. Check your email for details.

? What do you want to do? (Use arrow keys)
  Refresh
❯ Start
  Cancel
  ──────────────
  Go back

Then, select Confirm to start the migration:

? What do you want to do? Start

Your database ⛁ postgresql-clean-29349 will be unavailable after starting the migration until the migration is complete.
If there are any issues during the migration, we end the migration and make the source database available again.
The database ⛁ postgresql-clean-29349 can be offline for several hours during the migration.
You'll receive an email when the migration is complete.

? Confirm to start migration: (Use arrow keys)
❯ Confirm
  Go back

Starting migration of ⛁ postgresql-clean-29349 to ⛁ postgresql-circular-11223... done

After starting a snapshot migration, your source classic Postgres database becomes unavailable until the process completes.

If the migration fails, Heroku stops it and restores access to your source database. You receive an email when the migration completes. You can cancel the migration at any point before it begins promoting the destination database.

When the migration completes, its status shows Migration completed successfully. Check your email for details..

Step 4: Promote Your Destination Database

Verify the data on the newly migrated Advanced database to confirm the migration was successful.

After verifying the data, promote your destination Advanced database to use your app’s primary DATABASE attachment with heroku addons:attach.

First, create an alternate alias for your previous classic database. In this example, postgresql-clean-29349 is our source database for the migration:

$ heroku addons:attach postgresql-clean-29349 --as OLD_DATABASE -a example-app
Attaching ⛁ postgresql-clean-29349 as OLD_DATABASE to ⬢ example-app... done
Setting OLD_DATABASE config vars and restarting ⬢ example-app... done, v1047

Then, attach the new Advanced database with the primary DATABASE alias. In this example, postgresql-circular-11223 is our target database for the migration:

$ heroku addons:attach postgresql-circular-11223 --as DATABASE -a example-app
Attaching ⛁ postgresql-circular-11223 as DATABASE to ⬢ example-app... !
 ›   Warning: Adding DATABASE to app example-app would overwrite existing vars DATABASE_URL.

✔ To proceed, type example-app or re-run this command with --confirm example-app example-app
Attaching ⛁ postgresql-circular-11223 as DATABASE to ⬢ example-app... done
Setting DATABASE config vars and restarting ⬢ example-app... done, v1049

Step 5: Exit Maintenance Mode

To resume normal app operation, scale any non-web dynos back to their original levels (for example, heroku ps:scale worker=1).

Turn off maintenance mode:

$ heroku maintenance:off -a example-app
Disabling maintenance mode for ⬢ example-app... done

If you use Heroku Connect, resume your connection after exiting maintenance mode.

Step 6: Destroy Your Source Database

After the migration is complete and the new Advanced database works as expected with your app, destroy your old source classic database with heroku addons:destroy:

$ heroku addons:destroy postgresql-clean-29349 -a example-app
 ›   Warning: Destructive Action
 ›   This command will affect the app ⬢ example-app

✔ To proceed, type example-app or re-run this command with --confirm example-app example-app
Destroying postgresql-clean-29349 on ⬢ example-app... done

Troubleshooting

If you run into issues migrating your database, check your email for details on how to resolve. You can also see the Heroku Postgres Advanced Migration Failure Troubleshooting Guide for common migration failures and how to fix them.

Limitations

  • Follower databases: You can only configure migrations from a leader database. You can’t use follower databases as a migration source. To test a migration without impacting your production database, see Testing Migrations from Classic Heroku Postgres to Heroku Postgres Advanced.
  • Data connectors: Databases with active data connectors can’t migrate.
  • Version restrictions: The destination Advanced database must be on the same or a higher Postgres version than the source. Migrations support upgrading up to three major versions. You can’t migrate to a destination database running a lower Postgres version than the source.
  • Reserved credential names: Advanced-tier databases reserve certain credential names for platform use. If any credentials on your source database use reserved names, destroy them and recreate them with different names before preparing the migration. You receive an email with the affected credential names if the migration preparation checks detect any reserved credential names in your source database.
  • Essential databases: This migration process doesn’t support Essential-tier databases as the source database.
  • Dataclips: Dataclips associated with your source database don’t transfer to the Advanced database. You must recreate or re-attach them after migration. See Dataclip Recovery for details.
  • Temporal constraints: Primary key, unique, and foreign key constraints declared WITHOUT OVERLAPS or PERIOD in Postgres 18 can’t migrate. See our troubleshooting guide on how to resolve.
  • Database and role settings: Settings such as TimeZone, DateStyle, and IntervalStyle that you set for your database or roles don’t migrate. See our troubleshooting guide on how to resolve.
  • Replica identity set to an index: A replica identity set with REPLICA IDENTITY USING INDEX doesn’t migrate. See our troubleshooting guide on how to resolve.
  • Comments on indexes and constraints: Comments on indexes and constraints don’t migrate. See our troubleshooting guide on how to resolve.
  • Event triggers: Advanced databases don’t support creating event triggers. If your source database uses them, plan another way to get the same behavior. See our troubleshooting guide on how to resolve.

Additional Reading

  • Heroku Postgres Advanced category
  • Getting Started with Heroku Postgres Advanced

Feedback

Log in to submit feedback.

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure
  • .NET

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing
  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Github
  • LinkedIn
  • © 2026 Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States
  • heroku.com
  • Legal
  • Terms of Service
  • Privacy Information
  • Responsible Disclosure
  • Trust
  • Contact
  • Cookie Preferences
  • Your Privacy Choices