# MongoDB Auto Backup
# Overview
This chapter introduces how to set up auto backup for GROWI data using weseek/mongodb-awesome-backup (opens new window).
# Requirements
- Docker
- AWS S3 bucket to upload backup files
- Access key and secret key for a user authorized to access S3 bucket.
TIP
See MongoDB Backup & Restore before you start.
# Manage with a Container
Start a container with CRONMODE
true.docker run --rm \ -e MONGODB_HOST=<Target MongoDB Host> \ -e AWS_ACCESS_KEY_ID=<Your IAM Access Key ID> \ -e AWS_SECRET_ACCESS_KEY=<Your IAM Secret Access Key> \ -e S3_TARGET_BUCKET_URL=<Target S3 Bucket URL (s3://...)> \ -e CRONMODE=true \ -e "CRON_EXPRESSION=0 4 * * *" \ weseek/mongodb-awesome-backupThe container backs up all databases in the target MongoDB server at 4:00 AM everyday.
# Backup Version Control
- (TBD: Looking for a contributor)
TIP
See weseek/mongodb-awesome-backup (opens new window) for more options.
# Manage with docker-compose
TIP
If GROWI is installed with growi-docker-compose, preparing a backup container is even easier.
- Refer to growilabs/growi-docker-compose Example (opens new window), and follow the steps below.
clone
git clone https://github.com/growilabs/growi-docker-compose.git growi cd growiCopy
docker-compose.override.ymlto the root directory.cp -p examples/backup-mongodb-data/docker-compose.override.yml .Edit
docker-compose.override.ymland enter an appropriate value forCRON_EXPRESSION,AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY, andS3_TARGET_BUCKET_URL.... environment: - CRONMODE=true - CRON_EXPRESSION=0 4 * * * - AWS_ACCESS_KEY_ID=${Your IAM Access Key ID} - AWS_SECRET_ACCESS_KEY=${Your IAM Secret Access Key} - S3_TARGET_BUCKET_URL=s3://${Your Bucket Name}/ ...docker-compose up
# Manage with Google Cloud Platform
- (TBD: Looking for a contributor)