Backups and updates


Mockoon Pro stores all persistent application state (the SQLite database, settings, user accounts, license information, and synchronized mock environments) in a single /data directory inside the container.

 Backups and restores

 Creating a backup

Because the SQLite database runs in WAL (Write-Ahead Logging) mode, stop the container before copying files—or use a volume snapshot—to guarantee a consistent backup:

  1. Volume snapshots: Take periodic snapshots of the persistent volume attached to /data.
  2. File archive:
    Copy
    docker stop mockoon-pro docker run --rm \ -v mockoon-data:/data:ro \ -v "$(pwd)":/backup \ alpine tar -czf /backup/mockoon-data-backup.tar.gz -C /data . docker start mockoon-pro

 Restoring from a backup

  1. Extract your backup archive into the persistent storage directory (/data).
  2. Start the container with the storage volume attached.
  3. Mockoon Pro automatically detects the existing database and resumes operation without triggering the initial setup wizard.

 Updating Mockoon Pro

When a new version is released, back up your /data volume and update the container using the procedure matching your deployment method.

 With Docker Compose

  1. (Optional) Update the image tag: If you pinned a specific version tag in your docker-compose.yml (e.g. mockoon/pro:9.10.0), update it to the target version. If you are tracking latest, leave it as is.
  2. Pull the latest image:
    Copy
    docker compose pull
  3. Recreate and restart the service:
    Copy
    docker compose up -d
    Docker Compose stops the old container and starts the updated one with zero data loss.
  4. Verify startup logs:
    Copy
    docker compose logs -f mockoon-pro
  5. Clean up old dangling images (optional):
    Copy
    docker image prune -f

 With Standalone Docker

  1. Pull the new image:
    Copy
    docker pull mockoon/pro:latest
  2. Stop and remove the old container:
    Copy
    docker stop mockoon-pro docker rm mockoon-pro
  3. Start the new container with your existing volume mount and environment variables:
    Copy
    docker run -d \ --name mockoon-pro \ -p 5020:5020 \ -e NODE_ENV=production \ -e PORT=5020 \ -e MOCKOON_DOMAIN=mockoon.company.com \ -e MOCKOON_SERVER_ID=mockoon-node-1 \ -v mockoon-data:/data \ mockoon/pro:latest

 With Kubernetes / OpenShift

If tracking latest with imagePullPolicy: Always, restart the deployment rollout to pull the new image:

Copy
kubectl rollout restart deployment/mockoon-pro

Or update the pinned version tag in your manifest / Helm values and apply:

Copy
kubectl apply -f deployment.yaml

 Automated migrations and major upgrades

When the updated container starts, any required SQLite database migrations and internal state upgrades are executed automatically. Check the migrations for each version to review version-specific changes.

When updating to a new major version, Mockoon Pro automatically migrates all synchronized environments in /data, persists the changes, and updates the team's compatible major version before accepting connections. Desktop clients must also be updated to the same major version to remain compatible, while the embedded web application is updated automatically with the server.