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
Opening pgAdmin
Start pgAdmin on your computer.Select the Server
From the list of servers, choose the one that contains the database you want to back up.Select the Database
Locate the database you want in the navigation tree and select it.Start Backup
Right-click on the chosen database.
In the context menu, select the Backup... option.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.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
Open pgAdmin
Open pgAdmin on your computer.Select the server
Choose the server where you want to restore the database.Create an Empty Database
Create a new database with the same name as the database that was backed up.Start the Restore
Right-click on the created database.
In the context menu, select the option Restore....Configuring the Restore
Format: Choose Custom or tar.
Filename: Locate and select the.psql
backup file you created.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}}