# Back Up & Restore a PostgreSQL Database

> Canonical: https://jethost.com/kb/back-postgresql-backup-restore/ · Last modified: 2026-10-21T11:12:04+00:00

Backing up a PostgreSQL database means **exporting** it to a file; restoring or moving it means **importing** that file back. Both are done in **phpPgAdmin** in cPanel – handy before a big change, or when moving a site to JetHost. This guide covers export and import, step by step. phpPgAdmin is included with every [JetHost web hosting plan](https://jethost.com/web-hosting/).

## Open phpPgAdmin

Log in to cPanel and, in the **Databases** section, click **phpPgAdmin**. Your databases appear in the left sidebar – click the one you want to work with. For more on getting around the tool, see [accessing phpPgAdmin](https://jethost.com/kb/access-phppgadmin/).

## Export (back up) a database

1. Select your database in the left sidebar.
2. Click the **Export** option at the top.
3. Choose **Data and Structure**, and set the format to **SQL**.
4. Select **Download**, then click **Export**.

A `.sql` file downloads to your computer. It holds the whole database – both the structure and the data – so keep it somewhere safe.

## Import (restore or move) a database

Importing loads a `.sql` file back into a database. First make sure the target database exists – if not, [create one](https://jethost.com/kb/create-postgresql-database/) first. Then:

1. Select the target database in the left sidebar.
2. Click the **SQL** option at the top.
3. Click **Choose File** and select your `.sql` file from your computer.
4. Click **Execute** and wait for the confirmation.

Moving a site to JetHost? After importing, update your application’s config with the new database name, user, and password so it points to the imported copy. It’s also worth exporting on a regular schedule, not just before changes, so you always have a recent backup.

## JetHost Experts Tip

Importing a large `.sql` file through the browser can hit an upload limit. If your file is big, open a ticket and we’ll import it for you from the command line with `psql` – no size limit that way.

## Importing into a database that already has data

Importing doesn’t wipe the target database first – it runs the commands in your file on top of what’s already there. If the database already contains the same tables, you may see “already exists” or duplicate-key errors. For a clean restore, import into a freshly created, empty database, or make sure your export includes the statements to drop and recreate each table. When in doubt, create a brand-new database for the import and point your application at that once it’s loaded. This keeps your original data untouched until you’ve confirmed the restore worked.

## Need more help?

Backup or restore not going smoothly? Open a ticket through **Client Area → Support** and our team will help – we can also migrate your whole site for free.
