Neon is Generally Available! Serverless Postgres with branching to boost your development velocity.Read more

Import data from another Neon project

This guide describes how to migrate a database from one Neon project to another by piping data from pg_dump to pg_restore. Use these instructions to:

  • Import a database from a Neon project created in one region to a project created in another region.
  • Import a database from a Neon project created with one Postgres version to a Neon project created with another Postgres version.

Important considerations

  • Upgrading the Postgres version: When upgrading to a new version of Postgres, always test thoroughly before migrating your production systems or applications. We also recommend familiarizing yourself with the changes in the new version of Postgres, especially those affecting compatibility. For information about those changes, please refer to the official Postgres Release 15 or Release 16 documentation.
  • Piping considerations: Piping is not recommended for large datasets, as it is susceptible to failures during lengthy migration operations (see Pipe pg_dump to pg_restore for more information). If your dataset is large, we recommend performing the dump and restore as separate operations. For instructions, see Import data from Postgres.
  • Neon Free Tier project limit: The Neon Free Tier has a limit of one project per user, which means a Neon Free Tier user cannot have two projects simultaneously. To move your data from a Neon Free Tier project, dump your database first, delete your Neon project, create a new Neon project with the desired region or Postgres version, and import your data into the new project. For the dump and restore procedure, refer to Import from Postgres.

Import data from another project

To import your data from another Neon project:

  1. Create a new project with the desired region or Postgres version. See Create a project for instructions.

  2. Create a database with the desired name in your new Neon project. See Create a database for instructions.

  3. Retrieve the connection strings for the new and existing Neon databases.

    You can obtain the connection strings from the Neon Dashboard, under Connection Details. Connections strings have this format:

  4. Prepare your import command to pipe data to from one Neon project to the other. The command will look similar to this:

    pg_dump -Fc -v -d postgres://[user]:[password]@[neon_hostname]/[dbname] | pg_restore -v -d postgres://[user]:[password]@[neon_hostname]/[dbname]

    The command includes these arguments:

    • -Fc: Sends the output to a custom-format archive suitable for input into pg_restore.
    • -v: Runs commands in verbose mode, allowing you to monitor what happens during the operation.
    • -d: Specifies the database name or connection string.
  5. Run the command from your terminal or command window.

  6. If you no longer require the old project, you can remove it. See Delete a project for instructions.

Need help?

Join our Discord Server to ask questions or see what others are doing with Neon. Users on paid plans can open a support ticket from the console. For more detail, see Getting Support.

Last updated on

Edit this page
Was this page helpful?