Skip to main content
Skip table of contents

How to migrate data from a Postgresql database

This tutorial will guide you through the process of backing up and restoring a database in pgAdmin.

Backing up a database

  1. Opening pgAdmin
    Start pgAdmin on your computer.

  2. Select the Server
    From the list of servers, choose the one that contains the database you want to back up.

  3. Select the Database
    Locate the database you want in the navigation tree and select it.

  4. Start Backup
    Right-click on the chosen database.
    In the context menu, select the Backup... option.

  5. Configure the backup
    Filename: Choose the location where you want to save the file, and give the file a name with the extension .psql.
    Format: Select the Tar format for the backup.
    Encoding: Set the encoding to UTF8.

  6. Performing the backup
    Click on the blue Backup button to start the process.
    Once complete, the .psql backup file containing the database data will be generated in the path you chose.


Restoring a database

  1. Open pgAdmin
    Open pgAdmin on your computer.

  2. Select the server
    Choose the server where you want to restore the database.

  3. Create an Empty Database
    Create a new database with the same name as the database that was backed up.

  4. Start the Restore
    Right-click on the created database.
    In the context menu, select the option Restore....

  5. Configuring the Restore
    Format: Choose Custom or tar.
    Filename: Locate and select the .psql backup file you created.

  6. Performing the Restore
    Click on the blue Restore button to start the process.
    When the process is finished, the database data will be restored from the backup file.

{{component-feedback-article}}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.