Table of Contents [expand]
Last updated May 18, 2026
Forking creates a new database containing a snapshot of an existing database at the current point in time. Unlike follower databases, forks don’t stay up to date with the parent database and you can write to them. Forks don’t affect the performance of the parent database. This article describes the different methods of creating a fork on Advanced Postgres (Limited GA) databases and classic Postgres databases.
Forking is only supported on Advanced-tier and classic Standard-tier or higher database plans. Follow these steps to upgrade from an Essential-tier database to a plan in a higher tier.
Use Cases
Forks don’t affect the performance of the parent database.
Forked databases provide a risk-free way of working with your production data and schema. For example, you can use them to test new schema migrations or to load test your application on a different database plan. They’re also valuable as snapshots of your data at a particular point in time for later analysis or forensics.
Forks on Advanced Databases
Heroku Postgres Advanced is in limited general availability. To start creating and using Advanced databases, open a ticket with Heroku Support to request access. Subscribe to our changelog to stay informed of when Heroku Postgres Advanced is generally available.
Forking an Advanced database creates a copy of the data in the leader pool instance. A forked database doesn’t include a standby instance or high availability.
Create a Fork
You can’t create forks from another newly forked database for a short period of time. Use the data:pg:info command to check if Fork is Available.
Forks don’t have to be on the same instance plan level as the parent database. Forks can be on any level but must have enough disk space to contain the data from the parent database.
Preparing a fork can take anywhere from several minutes to several hours, depending on the size of your dataset.
Create Using the CLI
You can create forks with these options:
| Flag | Description |
|---|---|
--as |
Name the forked database attachment |
--level |
Set the compute scale level for the forked database |
--name |
Name the forked database |
--rollback-by, --rollback-to |
Fork your database back to a specific point in time. See Heroku Postgres Rollback for more information. |
--wait |
Watch the database fork creation status and exit when complete |
For example, this command creates a fork of your leader instance pool with a level of 16G-Performance and an attachment name of DATABASE_COPY:
$ heroku data:pg:fork HEROKU_POSTGRESQL_COBALT --app example-app --level 16G-Performance --as DATABASE_COPY
Creating a fork for HEROKU_POSTGRESQL_COBALT database on example-app
Your database fork will be available soon.
Create Using the Heroku Dashboard
You can also create forks through the web dashboard:
- Go to the
Datastorestab on the Heroku Dashboard. - Search and select the database you want to create a fork from.
- Click the
Settingstab. - Click
Fork Database. - Select the plan level for the fork.
- Enter the app’s name to confirm, and select
Fork Database.
Creating a fork through the CLI offers more options.
Delete a Fork
Delete Using the CLI
Deprovision a fork by using heroku data:pg:destroy:
$ heroku data:pg:destroy DATABASE_COPY --confirm example-app
Delete Using the Heroku Dashboard
- Go to the
Datastorestab on the Heroku Dashboard. - Search and select the fork database you want to delete.
- Click the
Settingstab. - Click
Destroy Database. - Enter the app’s name to confirm, and select
Delete Database.
Forks on Classic Databases
You can create forks on any classic Standard, Premium, Private, or Shield database that isn’t a follower.
Create a Fork
You can create forks on any Standard, Premium, Private, or Shield database that isn’t a follower.
You can’t create forks from another newly forked database for a short period of time. This limitation applies both to forks created by the methods described in this article and to forks created through unfollow. Use the pg:info command to check if Fork/Follow is Available.
Forks don’t have to be on the same database plan as the parent database. Forks can be on any plan but must have enough disk space to contain the data from the parent database.
Preparing a fork can take anywhere from several minutes to several hours, depending on the size of your dataset.
After forking a database, the app the fork is attached to updates with a new config var that contains the connection string for the new database. This config var update restarts the app.
Create Using the CLI
You can create forks using the Heroku CLI with the heroku addons:create command. Provision a new database add-on with the --fork flag. Supply the flag with one of the following identifiers to specify the database to create a fork from:
- The config var name of the database on the same app
- The name of the database add-on
- The full URL of any Heroku Postgres database
- An argument in the form of
appname::HEROKU_POSTGRESQL_COLOR_URL. This allows you to create a fork of a database that is attached to another app.
You can provide an alias for the new fork database with the --as option when running heroku addons:create. Heroku uses the provided alias as the attachment name for the new database and its related add-on config vars.
$ heroku addons:create heroku-postgresql:standard-0 --as DATABASE_COPY --app example-app -- --fork HEROKU_POSTGRESQL_CHARCOAL_URL
Creating heroku-postgresql:standard-0 on ⬢ example-app... ~$0.069/hour (max $50/month)
Database will become available after it completes forking.
Use `heroku pg:wait` to track status.
postgresql-parallel-47133 is being created in the background. The app will restart when complete...
Use heroku addons:info postgresql-parallel-47133 to check creation progress
Use heroku addons:docs heroku-postgresql to view documentation
The heroku pg:wait command outputs the provisioning status of any new databases. Use it to determine when the fork is up to date.
$ heroku pg:wait --app example-app
Waiting for database postgresql-parallel-47133... available
Create Using the Heroku Data Dashboard
You can also create forks through the web dashboard:
- Go to the
Datastorestab on the Heroku Dashboard. - Use the search and select the database you want to create a fork from.
- Click the
Settingstab. - Click
Fork Database.... - Choose the plan for the fork. Review the Create a Fork section for notes on selecting a plan size.
- Click
Fork Database.
The dashboard shows the status of the forked database and updates when the provisioning is complete.
Fork Fast Option
Fast forks can be up to 30 hours out-of-date.
You can create forks faster via the CLI with the --fast flag. This option is useful if no major changes, such as schema migrations or large data imports, occurred in your database in the last 30 hours.
$ heroku addons:create heroku-postgresql:standard-0 --app example-app -- --fork HEROKU_POSTGRESQL_CHARCOAL --fast
Creating heroku-postgresql:standard-0 on ⬢ example-app... ~$0.069/hour (max $50/month)
Fork will contain data from December 22, 2025 4:49 PM UTC (about 19 hours ago).
To create a fork with up-to-date data, exclude the `--fast` flag.
Database will become available after it completes forking.
Use `heroku pg:wait` to track status.
postgresql-animated-18515 is being created in the background. The app will restart when complete...
Use heroku addons:info postgresql-animated-18515 to check creation progress
Use heroku addons:docs heroku-postgresql to view documentation
Delete a Fork
Delete Using the CLI
Deprovision a fork using heroku addons:destroy:
$ heroku addons:destroy HEROKU_POSTGRESQL_SILVER --app example-app
› Warning: 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-animated-18515 on ⬢ example-app... done
Delete Using the Heroku Data Dashboard
- Go to the
Datastorestab on the Heroku Dashboard. - Use the search and select the fork database you want to delete.
- Click the
Settingstab. - Click
Delete Database.... - Type in the name of your app to confirm.
- Click
Delete Database.