Manual backup creation

Before you begin

Manual backup process assumes automated backup workflow is already configured and working properly.

Manual backup process invokes same Kubernetes cronjobs as for automated process.

Reasons for manual backup:

  • Before environment reset

  • Before OpenCRVS or dependencies upgrade

  • Migration to new hardware or cloud

  • Off-boarding from OpenCRVS

Following components are backed up:

  • MongoDB

  • PostgreSQL

  • MinIO

  • InfluxDB

Running all components backup

  1. Connect to your cluster with kubectl

  2. Change namespace to opencrvs-deps-<environment>:

    kubectl config set-context --current --namespace=opencrvs-deps-<environment>
  3. Run following command to trigger backup jobs for all components:

    for cj in $(kubectl get cronjob -l job-type=backup -o jsonpath='{.items[*].metadata.name}'); do \
      kubectl delete job $cj-job --ignore-not-found; \
      kubectl create job --from=cronjob/$cj $cj-job; \
    done

    Example output:

    job.batch "influxdb-backup-job" deleted
    job.batch/influxdb-backup-job created
    job.batch "minio-backup-job" deleted
    job.batch/minio-backup-job created
    job.batch "mongodb-backup-job" deleted
    job.batch/mongodb-backup-job created
    job.batch "postgres-backup-job" deleted
    job.batch/postgres-backup-job created
  4. Verify all jobs completed without issues:

    kubectl get job -ljob-type=backup

    Example output: Check job names like *-backup-job without ending number, jobs with number were triggered per schedule:

    NB01NSTL012:~ vmudryi$ kubectl get job -ljob-type=backup
    NAME                       STATUS     COMPLETIONS   DURATION   AGE
    influxdb-backup-29384700   Complete   1/1           12s        6h9m
    influxdb-backup-job        Complete   1/1           12s        2m31s
    minio-backup-29384700      Complete   1/1           9s         6h9m
    minio-backup-job           Complete   1/1           10s        2m30s
    mongodb-backup-29384700    Complete   1/1           18s        6h9m
    mongodb-backup-job         Complete   1/1           16s        2m29s
    postgres-backup-29384700   Complete   1/1           12s        6h9m
    postgres-backup-job        Complete   1/1           12s        2m28s
  5. SSH (Login) to backup server and verify backup was completed successfully.

Running Single component (MongoDB) backup

  1. Connect to your cluster with kubectl

  2. Change namespace to opencrvs-deps-<environment>:

  3. Run following command to trigger MongoDB backup:

    Example output:

  4. Verify MongoDB backup completed successfully:

    Example output:

Verify backup was created

  1. SSH (Login) to backup server

  2. Become backup user:

  3. Check backup directory content:

    Example output:

Last updated