Warning
This is not an official guide. This is a guide I created to transfer the data from one server to another. I'm not sure if this is the correct way to do it. Please use this guide at your own risk.
This guide provides a concise set of instructions to backup your Plausible Analytics CE Docker containers, migrate / move the data, and restore it on a new Ubuntu server. By following these steps, you can easily transfer your Plausible Analytics CE setup to a different server while preserving your valuable analytics data.
Compatible with:
- Ubuntu 22.04.2 LTS
- Plausible Analytics CE v2.0 (plausible/analytics:v2.0)
- Install Plausible Analytics CE on the new server.
- Make sure both source and destination servers are running the same version of Plausible Analytics CE.
-
Stop the running Plausible Analytics CE containers on the source server:
Note: This will stop all Docker containers, so make sure you don't have other containers running that you want to keep running.
docker stop $(docker ps -q)
-
Navigate to the Docker volumes directory:
cd /var/lib/docker/volumes
-
Create a compressed backup of the Plausible Analytics CE data:
tar -czvf plausible_data_backup.tar.gz plausible_db-data plausible_event-data metadata.db
-
Download the backup file to your local machine or transfer it directly to the new server.
-
Upload the backup file (
plausible_data_backup.tar.gz
) to the new server. -
On the new server, navigate to the directory where you want to restore the data:
cd /var/lib/docker/volumes
-
Extract the backup archive:
tar -xzvf plausible_data_backup.tar.gz
-
Start the Plausible Analytics CE containers on the new server:
(I've used the Portainer UI to start the containers)
docker-compose up -d
-
Verify that Plausible Analytics CE is running correctly on the new server.
Note:
- I'm not sure if the
metadata.db
file is needed or not. - I used this guide to transfer the Analytics data from a VPS that only had Plausible Analytics CE to a VPS with Portainer and Traefik.