Skip to content

Back up and restore DocumentDB with snapshots and logical backups - #268

Open
xgerman wants to merge 2 commits into
documentdb:mainfrom
xgerman:geeichbe/backup-restore-blog
Open

xgerman wants to merge 2 commits into
documentdb:mainfrom
xgerman:geeichbe/backup-restore-blog

Conversation

@xgerman

@xgerman xgerman commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a backup and restore tutorial covering:

  • Operator-managed volume snapshots, scheduled backups, and recovery into a new cluster.
  • Quiesced mongodump / mongorestore, with archive examples and consistency boundaries.
  • A current pg_dump / pg_restore administrator workaround: manually register collection/index metadata and ID sequences, verify archive contents, and restore in phases to avoid generated maintenance-job conflicts.

Reference documentdb/documentdb#737 as work to simplify PostgreSQL backup, not a prerequisite for following the manual procedure. Explain that standalone pg_extension_config_dump() calls are not allowed and clearly label the direct system-catalog update as a superuser workaround.

End-to-end verification

Used two isolated Podman containers with the latest public image as of November 20, 2026:

ghcr.io/documentdb/documentdb/documentdb-local@sha256:5da68829e51e55d32ccf6fb09e5733716c312a823a986976cbf817867cc3b299

Environment: DocumentDB 1.2-0, PostgreSQL 17.12, pg_cron 1.6, Linux arm64, Database Tools 100.18.0.

  • Confirmed an ordinary dump omitted collection/index catalog data and both ID sequence states before registration.
  • Extracted and executed the registration SQL directly from the article, twice, to check repeat execution.
  • Verified all four required archive entries after registration.
  • Restored roles and the full custom archive into a fresh database using pre-data, data, and post-data phases, clearing generated cron rows between phases.
  • Verified PostgreSQL recovery through the gateway: five documents in two application collections, dates, decimals, arrays, nested values, nulls, unique and descending indexes, duplicate rejection, and successful new collection/write/index creation.
  • Separately round-tripped the same application database with mongodump / mongorestore: five documents restored, zero failures, and the same gateway assertions passed.
  • Used self-signed-certificate bypasses only in disposable tests; published client examples retain certificate validation.
  • Built the final article with the locked Jekyll dependencies inside an isolated Ruby container and checked the generated article route.

Snapshot instructions follow the operator's published documentation; a Kubernetes snapshot recovery was not exercised in this test.

German and others added 2 commits November 20, 2026 11:07
Document snapshot recovery and verified logical backup procedures, including manual PostgreSQL metadata registration for issue #737.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 17ca83b9-e369-4644-bdb1-7302fc5d4f56
Signed-off-by: German <geeichbe@microsoft.com>
Apply editorial updates and explain that logical archives preserve index definitions while restore rebuilds the indexes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 17ca83b9-e369-4644-bdb1-7302fc5d4f56
Signed-off-by: German <geeichbe@microsoft.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant