Restoring Your Scalingo for PostgreSQL® Addon

Restoring a Point-in-Time Recovery Backup

Using the Database Dashboard

  1. From your web browser, open your database dashboard
  2. Click the Backups tab
  3. Locate the Point-in-Time Recovery block
  4. Pick a date and time
  5. Click the Restore Database button

Restoring a Periodic Backup

Using the Command Line

From a One-Off Container

  1. Follow the procedure to access your PostgreSQL® database from a one-off container
  2. From the one-off command line, download and install the Scalingo command line tool to complete the one-off setup:
    install-scalingo-cli
    
  3. Login to Scalingo:
    scalingo login
    
  4. Either download a backup, or use a dump made previously
  5. Uncompress the backup (this step is not necessary with a dump):
    tar -xvzf <archive>
    
  6. Restore the database from the uncompressed file or from the dump, using the pg_restore command:
    pg_restore --clean --if-exists --no-owner --no-privileges --no-comments --dbname "${SCALINGO_POSTGRESQL_URL}" <dump_file>
    

From Your Workstation

  1. Either download a backup, or create a dump
  2. Uncompress the backup (this step is not necessary with a dump):
    tar -xvzf <archive>
    
  3. Open a DB tunnel so you can access your database from your workstation
  4. Adjust the connection URI:
    export SCALINGO_DATABASE_URL="postgresql://<user>:<password>@127.0.0.1:<port>/<dbname>"
    

    With user, password and dbname from your original connection URI and port depending on what you did (default is 10000)

  5. Restore the database from the uncompressed file or from the dump, using the pg_restore command (you may have to install it):
    pg_restore --clean --if-exists --no-owner --no-privileges --no-comments --dbname "${SCALINGO_DATABASE_URL}" <dump_file>
    

Restoring a Manual Backup

Manual backups are considered like any Periodic backup. Consequently, please refer to the documentation explaining how to restore a Periodic backup.

Restoring a Dump

Dumps are considered like any Periodic backup. Consequently, please refer to the documentation explaining how to restore a Periodic backup.


Suggest edits

Restoring Your Scalingo for PostgreSQL® Addon

©2024 Scalingo