# PostgreSQL Database Backup

[](https://help.qlik.com/talend/en-US/talend-data-catalog/Content/deployment-guide/database-server-backup-restore/postgresql-database-backup.htm)

## Backup

To backup the repository database MM into a file `/backups/PostgreSQL/MM.dmp` use the following command:   
`pg_dump -b -f /backups/PostgreSQL/MM.dmp -F t -d "MM" -h localhost -w -p 5432 -U MM`

## Restore

To restore the file `/backups/PostgreSQL/MM.dmp` into the repository database MM use the following command. All database objects and data are dropped before recreating them.   
`pg_restore -c -F t -d "MM" -h localhost -w -p 5432 -U MM --if-exists /backups/PostgreSQL/MM.dmp`

You may refer to the PostgreSQL `pg_dump` and `pg_restore` documentation for more details on the above commands.