Import data from Heroku
This guide describes how to import your data from Heroku PostgreSQL to Neon.
The instructions assume that you have installed the Heroku CLI, which is used to transfer data from Heroku. For installation instructions, see The Heroku CLI.
To migrate your data from Heroku to Neon:
- Create a Neon project and copy the connection string
- Retrieve your Heroku app name and database name
- Import your data
- Verify that your data was imported
Create a Neon project and copy the connection string
Navigate to the Projects page in the Neon Console.
Click New Project.
Specify your project settings and click Create Project.
After creating a project, you are directed to the Neon Dashboard, where a connection string with your password is provided under Connection Details. Copy the connection string. It is required to import your data from Heroku.
The example connection string used the instructions that follow is:
Retrieve your Heroku app name and database name
- Log in to Heroku and select the project you want to import data from.
- Select Overview and copy the name of the Heroku Postgres database, which appears under Installed add-ons.
- Click Settings and copy your Heroku App Name.
You can also retrieve the Heroku Postgres database name using the following Heroku CLI command:
<app> is the Heroku App Name.
Import your data
From your terminal, run the following Heroku CLI command:
<app>is the name of the Heroku app
<heroku-pg-database>is the name of the Heroku PostgreSQL database
<neon-connection-string>is the Neon connection string
Verify that your data was imported
- Log in to the Neon Console.
- Select the Neon project that you transferred data to.
- Select the Tables tab.
- In the sidebar, verify that your database tables appear under the Tables heading.
Send a request to email@example.com, or join the Neon community forum.