Skip to content

Restoring from R2 or S3 Backup

If you’ve used the Bootstrapper to set up automated S3 or R2 backups, a tool exists for restoring that data if it’s ever needed.

Required Steps

In order to use this, you’ll need to have configured automated backups, and have a backup from which to restore your data.


Required Environment Variables

The following environment variables will be used during the restoratino process.

Environment VariableRequired?Description
PB_BACKUP_ENDPOINT_URLYesFind this value based on your provider by reading below.
PB_BACKUP_BUCKET_NAMENoThe name of the bucket data used to store backup data.

Once you have these values, export them in your active terminal session before running the restoration tool. For example:

Terminal window
export PB_BACKUP_ENDPOINT_URL=https://s3.us-east-2.amazonaws.com
# Only if you used a custom bucket name during the backup setup process:
export PB_BACKUP_BUCKET_NAME=plausible-backups-s3

Running the Restoration Process

At this point, you’re ready to run the restoration command. Keep this in mind:

  • Running the script will totally wipe out any data currently in your instance.
  • During the restoration process, your instance will momentarily shut down.

If that’s cool with you, run the following in the same terminal session where you exported the afforementioned variables:

curl -SL https://plausiblebootstrapper.com/restore | bash

After kicking it off, you’ll see feedback showing your backup being pulled locally, and stored into your Plausible instance. When it’s all said & done, you’ll see a confirmation message. Give it a minute or two for your instance to start up again, and you’re set!