Migrate RDS for PPAS to local PPAS

Last Updated: Dec 08, 2017

ApsaraDB for PPAS supports the migration of cloud data to the local database by using logical backup files.

Procedure

  1. Connect the PostgreSQL client to RDS.

  2. Run the following command to back up the data.

    1. pg_dump -U username -h hostname -p port databasename -f filename

    Parameters are described as follows:

    • username: Indicates the username used for database logon.

    • hostname: Indicates the host name of the database.

    • port: Indicates the database port number.

    • databasename: Indicates the name of the database you want to back up.

    • filename: Name of the backup file to be generated.

      For example:

      1. pg_dump -U ppas_user -h rdsv07z563m7o25cj550public.ppas.rds.aliyuncs.com -p 3433 edb -f ppas.sql
  3. Save the ppas.sql backup file to the target server.

  4. Run the following command to recover data to the local database:

    1. psql -U username -h hostname -d desintationdb -p port -f dumpfilename.sql

    Parameters are described as follows:

    • username: Indicates the username used for database logon.

    • hostname: Indicates the database address.

    • port: Indicates the database port number.

    • databasename: Indicates the database name.

    • filename: Indicates the backup file name.

    For example:

    1. psql -U ppas_user -h localhost -d edb -p 5444 -f ppas.sql

    As the permission settings of the RDS database are different from those of the local database, some permission related warnings or errors may occur during data import. They can be ignored, for example:

    1. WARNING: no privileges could be revoked for "xxxxx"
    2. ERROR: role "xxxxx" does not exist
Thank you! We've received your feedback.