Skip to content

Backup Docker Installation #1132

Jun 17, 2021 · 6 comments · 5 replies
Discussion options

You must be logged in to vote

I self-host Plausible on Kubernetes and wrote DB-level backup scripts that I run daily against Plausible using cron. Restore scripts are also available:

https://github.com/schnerring/k8s-backup-scripts

The scripts aren't really applicable to docker-compose, but you can try to extract the important bits from the scripts and adjust them accordingly.

Use pg_dump to backup Plausible DB:

backup_postgres() {
  echo "Backing up Postgres ..."
  pod=$(get_pod_name "${POSTGRES_LABEL}" "${POSTGRES_NAMESPACE}")
  kubectl exec -i -n "${POSTGRES_NAMESPACE}" "$pod" -- \
    pg_dump -Fc "${PLAUSIBLE_DB}" >"${PLAUSIBLE_BACKUP_DIR}/$(date +%y%m%d)-postgres-${PLAUSIBLE_DB}.dump"
}

Use clickhouse-backup for …

Replies: 6 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@asbrwl
Comment options

@tallesairan
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@johakr
Comment options

@simardcasanova
Comment options

@Sayyiku
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by cschellhas
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet