Compare commits
13 Commits
1.2.0+1.35
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 1936226bf5 | |||
| 0865766102 | |||
| 475484928f | |||
| 3158926e7b | |||
| 8ae0634c82 | |||
| ca1e0ec1c3 | |||
| 14b65c2ecd | |||
| c5994bd7e4 | |||
| 136ad45cfb | |||
| 26e98e915d | |||
| aa6b8472f5 | |||
| f19c498001 | |||
| db18e08971 |
22
backup-postgres.sh
Normal file
22
backup-postgres.sh
Normal file
@ -0,0 +1,22 @@
|
||||
if [ "$1" == "pre-backup" ]; then
|
||||
# Remove any existing db dump and then create a new one
|
||||
rm -rf $DATA_DIR/postgres/postgres-backup
|
||||
source /baserow/data/.pgpass
|
||||
PGPASSWORD=$DATABASE_PASSWORD pg_dump -j 8 -h localhost -U baserow baserow --format=directory -f $DATA_DIR/postgres/postgres-backup
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$1" == "post-backup" ]; then
|
||||
rm -rf $DATA_DIR/postgres/postgres-backup
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$1" == "pre-restore" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$1" == "post-restore" ]; then
|
||||
source /baserow/data/.pgpass
|
||||
PGPASSWORD=$DATABASE_PASSWORD pg_restore -j 8 -h localhost -U baserow -d baserow -c $DATA_DIR/postgres/postgres-backup
|
||||
exit
|
||||
fi
|
||||
15
compose.yml
15
compose.yml
@ -30,20 +30,31 @@ services:
|
||||
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
||||
- "backupbot.backup=true"
|
||||
- "backupbot.backup.path=/baserow/data"
|
||||
- "coop-cloud.${STACK_NAME}.version=1.2.0+1.35.3"
|
||||
- "backupbot.backup.pre-hook=/backup.sh pre-backup"
|
||||
- "backupbot.backup.post-hook=/backup.sh post-backup"
|
||||
- "backupbot.restore.post-hook=/backup.sh post-restore"
|
||||
- "coop-cloud.${STACK_NAME}.version=1.3.0+1.35.3"
|
||||
healthcheck:
|
||||
test: ["CMD", "./baserow.sh", "backend-cmd", "backend-healthcheck"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
start_period: 1m
|
||||
|
||||
volumes:
|
||||
- baserow_data:/baserow/data
|
||||
configs:
|
||||
- source: backup-postgres
|
||||
target: /backup.sh
|
||||
mode: 0777
|
||||
|
||||
volumes:
|
||||
baserow_data:
|
||||
|
||||
configs:
|
||||
backup-postgres:
|
||||
name: backup-postgres_${PG_BACKUP_CONFIG_VERSION}
|
||||
file: ./backup-postgres.sh
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
|
||||
1
release/1.3.0+1.35.3
Normal file
1
release/1.3.0+1.35.3
Normal file
@ -0,0 +1 @@
|
||||
Backup/restore of the postgres database backend will now use pg_dump and pg_restore
|
||||
Reference in New Issue
Block a user