Updated and revised on June 13, 2023 for Plausible Analytics V1.5 and V2
The on-premise solution is based on Docker, which makes the backup and restore process slightly more complicated. However, with the commands described below, backing up and restoring Plausible is straightforward.
In the first step, you need to navigate to the directory where Plausible is installed:
Next, the running Plausible environment needs to be shut down:
In the next step, a backup directory is created in the home directory:
Then, the Plausible database and event data are backed up:
docker run -v plausible_db-data:/volume --rm --log-driver none loomchild/volume-backup backup > $HOME/backups/plausible_db-data.tar.bz2 docker run -v plausible_event-data:/volume --rm --log-driver none loomchild/volume-backup backup > $HOME/backups/plausible_event-data.tar.bz2
Now, in the backup directory, you should have two files:
plausible_event-data.tar.bz2, which contain the backed-up data.
To restore a backup, Plausible needs to be stopped first:
In the next step, the actual backup is restored:
docker run -i -v plausible_db-data:/volume --rm loomchild/volume-backup restore < $HOME/backups/plausible_db-data.tar.bz2 docker run -i -v plausible_event-data:/volume --rm loomchild/volume-backup restore < $HOME/backups/plausible_event-data.tar.bz2