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. Click the Start a PiTR button
  5. Pick a date and time (timezone is UTC)
  6. Make sure to check the I understand that this action will permanently delete existing data and cannot be cancelled or undone once started. checkbox
  7. Validate by clicking the Confirm button

Restoring a Scheduled 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 Scheduled backup. Consequently, please refer to the documentation explaining how to restore a Scheduled backup.

Restoring a Dump

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


Suggest edits

Restoring Your Scalingo for PostgreSQL® Addon

©2024 Scalingo