Adapt recipe to Docs v6 (yhub collaboration server)
- the new yhub service needs new initialisation and RSA keys - SOFT_MIGRATION on by default, add migrate_documents command - back up the yhub database too - document the v5 -> v6 upgrade in README and release/next Following the [C4DT AI Policy](https://git.coopcloud.tech/c4dt/ai-policy/src/branch/main/AI-POLICY.md): #LLM_vibe #LLM_model Claude Opus 5.5 - [x] I take full responsibility for this code - [x] I understand every line of this code - [x] I tested this code thoroughly on my own computer / servers - [x] None of the commit messages were created using LLMs - [x] I will participate in any discussion on my own and will not use an LLM for the discussion
This commit is contained in:
committed by
autonomic-bot
parent
32cc9b0190
commit
262bd5a02e
@@ -3,10 +3,16 @@
|
||||
set -e
|
||||
|
||||
BACKUP_FILE='/var/lib/postgresql/data/pgdata/backup.sql'
|
||||
# database of the collaboration server (yhub), since v6
|
||||
YHUB_DB='yhub'
|
||||
YHUB_BACKUP_FILE='/var/lib/postgresql/data/pgdata/backup-yhub.sql'
|
||||
|
||||
function backup {
|
||||
export PGPASSWORD=$(cat $POSTGRES_PASSWORD_FILE)
|
||||
pg_dump -U ${POSTGRES_USER} ${POSTGRES_DB} > $BACKUP_FILE
|
||||
if psql -U ${POSTGRES_USER} -d postgres -tAc "SELECT 1 FROM pg_database WHERE datname='${YHUB_DB}'" | grep -q 1; then
|
||||
pg_dump -U ${POSTGRES_USER} ${YHUB_DB} > $YHUB_BACKUP_FILE
|
||||
fi
|
||||
}
|
||||
|
||||
function restore {
|
||||
@@ -27,6 +33,12 @@ function restore {
|
||||
createdb -U ${POSTGRES_USER} ${POSTGRES_DB}
|
||||
psql -U ${POSTGRES_USER} -d ${POSTGRES_DB} -1 -f $BACKUP_FILE
|
||||
|
||||
if [ -f $YHUB_BACKUP_FILE ]; then
|
||||
psql -U ${POSTGRES_USER} -d postgres -c "DROP DATABASE IF EXISTS ${YHUB_DB} WITH (FORCE);"
|
||||
createdb -U ${POSTGRES_USER} ${YHUB_DB}
|
||||
psql -U ${POSTGRES_USER} -d ${YHUB_DB} -1 -f $YHUB_BACKUP_FILE
|
||||
fi
|
||||
|
||||
trap - EXIT INT TERM
|
||||
restore_config
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user