Skip to content

Instantly share code, notes, and snippets.

@ruibeard
Last active March 16, 2025 06:50
Show Gist options
  • Save ruibeard/34721c78fa70dcd28545053e7a7e3deb to your computer and use it in GitHub Desktop.
Save ruibeard/34721c78fa70dcd28545053e7a7e3deb to your computer and use it in GitHub Desktop.
Plausible Analytics CE Backup and Restore

Plausible Analytics CE Docker Backup and Restore: Migrate and Transfer Data to a New Server

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)

Prerequisites

  • Install Plausible Analytics CE on the new server.
  • Make sure both source and destination servers are running the same version of Plausible Analytics CE.

Backup Process

  1. 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)
    
  2. Navigate to the Docker volumes directory:

    cd /var/lib/docker/volumes
    
  3. 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
    
  4. Download the backup file to your local machine or transfer it directly to the new server.

Transfer and Restore Process

  1. Upload the backup file (plausible_data_backup.tar.gz) to the new server.

  2. On the new server, navigate to the directory where you want to restore the data:

    cd /var/lib/docker/volumes
    
  3. Extract the backup archive:

    tar -xzvf plausible_data_backup.tar.gz
    
  4. Start the Plausible Analytics CE containers on the new server:

    (I've used the Portainer UI to start the containers)

    docker-compose up -d
    
  5. 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment