Skip to content

Add CKAN database restore tool - #12

Merged
amar-gds-ndl merged 4 commits into
mainfrom
feature/ckan-database-restore
Aug 10, 2026
Merged

Add CKAN database restore tool#12
amar-gds-ndl merged 4 commits into
mainfrom
feature/ckan-database-restore

Conversation

@amar-gds-ndl

Copy link
Copy Markdown
Contributor

Add restore script and Docker image for reliable CKAN database restore.

Uses download-first approach instead of streaming to avoid broken pipe errors on large backups (49GB+).

What it does:

  • Downloads backup from S3 with automatic retries
  • Decompresses locally
  • Restores using pg_restore from local file

Why: Old streaming approach kept failing after 60-70 minutes when pg_restore stalled during index building.

Ready to build in GitHub Actions and push to Integration ECR.

Add restore script and Docker image for reliable CKAN database restore
from S3 backups. Uses download-first approach to avoid streaming
pressure that was causing broken pipe errors on large backups.

Script includes:
- Download backup from S3 with automatic retries
- Decompress locally
- Restore from file using pg_restore

This avoids the streaming approach that was failing after 60-70 minutes
on 49GB backups. Ready for Integration account ECR push.
- Sort imports according to ruff style
- Remove unused shutil import
- Remove unused datetime import
Move pathlib import before third-party imports
This is a standalone utility script not part of the main application
@amar-gds-ndl
amar-gds-ndl merged commit 53c02c5 into main Aug 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant