Restore PMM Server Docker container¶
You can restore PMM Server either from a manual backup or from an automated backup volume that was created during migration to PMM v3.
Before you begin¶
Before proceeding with restoration, ensure you have one of the following:
- a manual backup you previously created. Make sure to verify its integrity using the verification procedures in the back up guide.
- an automated backup volume created during migration from PMM V3
Restore methods¶
Choose the restoration method that matches how your backup was created:
Restore from a backup volume created using the volume-to-volume method:
-
Stop the current PMM Server container:
docker stop pmm-server
-
Remove the current container:
docker rm pmm-server
-
Choose a restauration option:
- Replace current volume with backup volume:
# Remove current volume (WARNING: This deletes current data) docker volume rm pmm-data # Restore from backup volume to new pmm-data volume docker volume create pmm-data sudo docker run --rm -v <backup-volume-name>:/from -v pmm-data:/to alpine ash -c 'cp -av /from/. /to'
- Use backup volume directly:
# Start PMM Server using backup volume directly docker run -d \ --publish 443:8443 \ --volume <backup-volume-name>:/srv \ --name pmm-server \ --restart always \ percona/pmm-server:3
- Replace current volume with backup volume:
-
Verify the restored PMM Server is working correctly:
docker logs pmm-server
Restore from a host directory backup:
-
Stop the current PMM Server container:
docker stop pmm-server
-
Remove the current container:
docker rm pmm-server
-
Copy backup data to PMM volume:
# Remove current volume (WARNING: This deletes current data) docker volume rm pmm-data # Create new pmm-data volume docker volume create pmm-data # Copy directory backup to volume docker run --rm -v $(pwd)/<backup-directory>:/backup -v pmm-data:/srv alpine sh -c 'cp -r /backup/* /srv/'
-
Fix ownership of restored files:
docker run --rm -v pmm-data:/srv -t percona/pmm-server:3 chown -R pmm:pmm /srv
-
Start the restored PMM Server:
docker run -d \ --publish 443:8443 \ --volume pmm-data:/srv \ --name pmm-server \ --restart always \ percona/pmm-server:3
Rollback from PMM 3 to PMM 2 using automated migration backup:
-
Stop the current PMM v3 container:
docker stop pmm-server
-
Remove the PMM v3 container:
docker rm pmm-server
-
Start a PMM v2 container using your backup volume:
docker run -d \ -p 443:443 \ --volume <backup-volume-name>:/srv \ --name pmm-server \ --restart always \ percona/pmm-server:2.44.0
Replace
<backup-volume-name>
with your PMM v2 backup volume name (e.g.,pmm-data-2025-01-16-165135
). -
Verify that your PMM v2 instance is running correctly:
docker logs pmm-server # Check that all your data is accessible via the web interface
Use this as a fallback method when:
- you created a backup using
docker cp pmm-server-backup:/srv .
- you have a backup directory with an
srv/
folder containing PMM data - you used the Universal container copy backup option
- other restore methods don’t match your backup type
To restore from a universal container:
-
Stop the current PMM Server container:
docker stop pmm-server
-
Remove the container:
docker rm pmm-server
-
Restore the renamed backup container:
docker rename pmm-server-backup pmm-server
-
Navigate to the backup directory:
cd pmm-data-backup-YYYYMMDD-HHMMSS
-
Copy the backup data to the PMM data volume:
docker run --rm -v $(pwd)/srv:/backup -v pmm-data:/srv -t percona/pmm-server:3 cp -r /backup/* /srv
-
Fix ownership of the restored files:
docker run --rm -v pmm-data:/srv -t percona/pmm-server:3 chown -R pmm:pmm /srv
-
Start the restored PMM Server container:
docker start pmm-server
Find your backup volume name¶
If you’re restoring from an automated migration backup and don’t know the volume name:
- your backup volume name was displayed during the automated upgrade process.
-
to list all available Docker volumes, use the following command and look for volumes with names like
pmm-data-YYYY-MM-DD-HHMMSS
:docker volume ls
Next steps¶
- Create a backup of your PMM Server
- Upgrade your PMM Server to a newer version
- Migrate from PMM v2 to v3 if restoring to upgrade