Skip to content

Commit a13622a

Browse files
authored
Update how-to-migrate-using-dump-and-restore.md
- Remove invalid `pg_restore` flag `-Fc` - Fix username in `pg_restore` example for Flexible Server (remove `@my-target-server`)
1 parent e6d8f6d commit a13622a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/postgresql/migrate/how-to-migrate-using-dump-and-restore.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,18 @@ pg_dump -h my-source-server-name -U source-server-username -Fc -d source-databas
8484

8585
- Open the dump file to verify that the create index statements are after the insert of the data. If it isn't the case, move the create index statements after the data is inserted. This should already be done by default, but it's a good idea to confirm.
8686

87-
- Restore with the switches `-Fc` and `-j` (with a number) to parallelize the restore. The number you specify is the number of cores on the target server. You can also set to twice the number of cores of the target server to see the impact.
87+
- Restore with the `-j N` switch (where `N` represents the number) to parallelize the restore. The number you specify is the number of cores on the target server. You can also set to twice the number of cores of the target server to see the impact.
8888

8989
Here's an example for how to use this `pg_restore` for Single Server:
9090

9191
```bash
92-
pg_restore -h my-target-server.postgres.database.azure.com -U azure-postgres-username@my-target-server -Fc -j 4 -d my-target-databasename Z:\Data\Backups\my-database-backup.dump
92+
pg_restore -h my-target-server.postgres.database.azure.com -U azure-postgres-username@my-target-server -j 4 -d my-target-databasename Z:\Data\Backups\my-database-backup.dump
9393
```
9494

9595
Here's an example for how to use this `pg_restore` for Flexible Server:
9696
9797
```bash
98-
pg_restore -h my-target-server.postgres.database.azure.com -U azure-postgres-username@my-target-server -Fc -j 4 -d my-target-databasename Z:\Data\Backups\my-database-backup.dump
98+
pg_restore -h my-target-server.postgres.database.azure.com -U azure-postgres-username -j 4 -d my-target-databasename Z:\Data\Backups\my-database-backup.dump
9999
```
100100
101101
- You can also edit the dump file by adding the command `set synchronous_commit = off;` at the beginning, and the command `set synchronous_commit = on;` at the end. Not turning it on at the end, before the apps change the data, might result in subsequent loss of data.
@@ -113,4 +113,4 @@ Remember to test and validate these commands in a test environment before you us
113113
## Next steps
114114

115115
- To migrate a PostgreSQL database by using export and import, see [Migrate your PostgreSQL database using export and import](how-to-migrate-using-export-and-import.md).
116-
- For more information about migrating databases to Azure Database for PostgreSQL, see the [Database Migration Guide](/data-migration/).
116+
- For more information about migrating databases to Azure Database for PostgreSQL, see the [Database Migration Guide](/data-migration/).

0 commit comments

Comments
 (0)