Skip to main content
  1. Articles/

How to Export a Remote PostgreSQL Database and Import it locally?

·1 min
Mayukh Datta
Technical SQL
  1. Create a dump of the remote database using pg_dump command
> db_export.sql

You will get a dump SQL file of the remote database upon successful completion of this process.

  1. Create a database on your local setup with the same name as the remote database.
-c 'create database database_name;

The database has now been created on your local machine.

  1. Import the data to your local database.
database_name < db_export.sql

And, done!