Restoring Your Scalingo for PostgreSQL® Addon
Restoring a Point-in-Time Recovery Backup
Using the Database Dashboard
- From your web browser, open your database dashboard
- Click the Backups tab
- Locate the Point-in-Time Recovery block
- Click the Start a PiTR button
- Pick a date and time (timezone is UTC)
- Make sure to check the I understand that this action will permanently delete existing data and cannot be cancelled or undone once started. checkbox
- Validate by clicking the Confirm button
Restoring a Scheduled Backup
Using the Command Line
From a One-Off Container
- Follow the procedure to access your PostgreSQL® database from a one-off container
- From the one-off command line, download and install the Scalingo command
line tool to complete the one-off setup:
install-scalingo-cli
- Login to Scalingo:
scalingo login
- Either download a backup, or use a dump made previously
- Uncompress the backup (this step is not necessary with a dump):
tar -xvzf <archive>
- 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
- Either download a backup, or create a dump
- Uncompress the backup (this step is not necessary with a dump):
tar -xvzf <archive>
- Open a DB tunnel so you can access your database from your workstation
- Adjust the connection URI:
export SCALINGO_DATABASE_URL="postgresql://<user>:<password>@127.0.0.1:<port>/<dbname>"
With
user
,password
anddbname
from your original connection URI andport
depending on what you did (default is10000
) - 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.
Last update: 10 Dec 2024
Suggest edits