# Restoring a Database Backup After Migration

If you need to restore a particular backup from before migration to PostgreSQL, you would need to set up a new PostgreSQL instance and then complete the following steps:

1. Extract the backup (.bak) files into a directory; ensure the Database Migrator can see both the location to which you've extracted these files as well as the new database.

2. Run the Database Migrator, specifying the directory containing the extracted backup database directories.

```
   java -jar nexus-db-migrator-*.jar --migration_type=postgres --db_url="jdbc:postgresql://<database URL>:<port>/nexus?user=<postgres_user>&password=<postgres_password>" --orient.folder=<absolute/path/to/folder/of/extracted/files>
   ```
   
   The migrator expects the `--orient.folder` contains the component, config, and security directories.

3. Point your Nexus Repository instance to the new database.

See [Configuring Nexus Repository Pro for H2 or PostgreSQL](https://help.sonatype.com/en/install-nexus-repository-with-a-postgresql-database.html "Install Nexus Repository with a PostgreSQL Database")
