Skip to content

Commit 919a1b9

Browse files
authored
Merge pull request #89561 from rachel-msft/edits924
Update output
2 parents 3913111 + 04156d9 commit 919a1b9

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

articles/postgresql/howto-migrate-using-dump-and-restore.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,27 @@ author: rachel-msft
55
ms.author: raagyema
66
ms.service: postgresql
77
ms.topic: conceptual
8-
ms.date: 5/6/2019
8+
ms.date: 09/24/2019
99
---
10+
1011
# Migrate your PostgreSQL database using dump and restore
11-
You can use [pg_dump](https://www.postgresql.org/docs/9.3/static/app-pgdump.html) to extract a PostgreSQL database into a dump file and [pg_restore](https://www.postgresql.org/docs/9.3/static/app-pgrestore.html) to restore the PostgreSQL database from an archive file created by pg_dump.
12+
You can use [pg_dump](https://www.postgresql.org/docs/current/static/app-pgdump.html) to extract a PostgreSQL database into a dump file and [pg_restore](https://www.postgresql.org/docs/current/static/app-pgrestore.html) to restore the PostgreSQL database from an archive file created by pg_dump.
1213

1314
## Prerequisites
1415
To step through this how-to guide, you need:
1516
- An [Azure Database for PostgreSQL server](quickstart-create-server-database-portal.md) with firewall rules to allow access and database under it.
16-
- [pg_dump](https://www.postgresql.org/docs/9.6/static/app-pgdump.html) and [pg_restore](https://www.postgresql.org/docs/9.6/static/app-pgrestore.html) command-line utilities installed
17+
- [pg_dump](https://www.postgresql.org/docs/current/static/app-pgdump.html) and [pg_restore](https://www.postgresql.org/docs/current/static/app-pgrestore.html) command-line utilities installed
1718

1819
Follow these steps to dump and restore your PostgreSQL database:
1920

2021
## Create a dump file using pg_dump that contains the data to be loaded
2122
To back up an existing PostgreSQL database on-premises or in a VM, run the following command:
2223
```bash
23-
pg_dump -Fc -v --host=<host> --username=<name> --dbname=<database name> > <database>.dump
24+
pg_dump -Fc -v --host=<host> --username=<name> --dbname=<database name> -f <database>.dump
2425
```
2526
For example, if you have a local server and a database called **testdb** in it
2627
```bash
27-
pg_dump -Fc -v --host=localhost --username=masterlogin --dbname=testdb > testdb.dump
28+
pg_dump -Fc -v --host=localhost --username=masterlogin --dbname=testdb -f testdb.dump
2829
```
2930

3031

@@ -51,14 +52,14 @@ pg_restore -v --no-owner --host=mydemoserver.postgres.database.azure.com --port=
5152
One way to migrate your existing PostgreSQL database to Azure Database for PostgreSQL service is to back up the database on the source and restore it in Azure. To minimize the time required to complete the migration, consider using the following parameters with the backup and restore commands.
5253

5354
> [!NOTE]
54-
> For detailed syntax information, see the articles [pg_dump](https://www.postgresql.org/docs/9.6/static/app-pgdump.html) and [pg_restore](https://www.postgresql.org/docs/9.6/static/app-pgrestore.html).
55+
> For detailed syntax information, see the articles [pg_dump](https://www.postgresql.org/docs/current/static/app-pgdump.html) and [pg_restore](https://www.postgresql.org/docs/current/static/app-pgrestore.html).
5556
>
5657
5758
### For the backup
5859
- Take the backup with the -Fc switch so that you can perform the restore in parallel to speed it up. For example:
5960

6061
```
61-
pg_dump -h MySourceServerName -U MySourceUserName -Fc -d MySourceDatabaseName > Z:\Data\Backups\MyDatabaseBackup.dump
62+
pg_dump -h MySourceServerName -U MySourceUserName -Fc -d MySourceDatabaseName -f Z:\Data\Backups\MyDatabaseBackup.dump
6263
```
6364
6465
### For the restore

articles/postgresql/howto-migrate-using-export-and-import.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ author: rachel-msft
55
ms.author: raagyema
66
ms.service: postgresql
77
ms.topic: conceptual
8-
ms.date: 5/6/2019
8+
ms.date: 09/24/2019
99
---
1010
# Migrate your PostgreSQL database using export and import
1111
You can use [pg_dump](https://www.postgresql.org/docs/current/static/app-pgdump.html) to extract a PostgreSQL database into a script file and [psql](https://www.postgresql.org/docs/current/static/app-psql.html) to import the data into the target database from that file.
1212

1313
## Prerequisites
1414
To step through this how-to guide, you need:
1515
- An [Azure Database for PostgreSQL server](quickstart-create-server-database-portal.md) with firewall rules to allow access and database under it.
16-
- [pg_dump](https://www.postgresql.org/docs/9.6/static/app-pgdump.html) command-line utility installed
17-
- [psql](https://www.postgresql.org/docs/9.6/static/app-psql.html) command-line utility installed
16+
- [pg_dump](https://www.postgresql.org/docs/current/static/app-pgdump.html) command-line utility installed
17+
- [psql](https://www.postgresql.org/docs/current/static/app-psql.html) command-line utility installed
1818

1919
Follow these steps to export and import your PostgreSQL database.
2020

0 commit comments

Comments
 (0)