Skip to content

Commit

Permalink
PHRAS-3991: pre upgrade backup WIP (#4445)
Browse files Browse the repository at this point in the history
* PHRAS-3991: pre upgrade backup WIP

* wip

* gz option
  • Loading branch information
nmaillat authored Dec 16, 2023
1 parent ea02a9a commit 02b0445
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,11 @@ PHRASEANET_CAPTION_DIR=./tmp/caption
# @run
PHRASEANET_WORKER_TMP=./tmp/worker

# @run
PHRASEANET_BACKUP_DIR=./backup

# @run
PHRASEANET_FTP_DIR=./ftp

# --- Phraseanet plugin support settings -------------------------------------------------------------------------------

Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ services:
- ${PHRASEANET_PLUGINS_DIR}:/var/alchemy/Phraseanet/www/plugins:rw
- ${PHRASEANET_CACHE_DIR}:/var/alchemy/Phraseanet/cache:rw
- ${PHRASEANET_TMP_DIR}:/var/alchemy/Phraseanet/tmp:rw
- ${PHRASEANET_BACKUP_DIR}:/var/alchemy/Phraseanet/backup:rw
networks:
- internal

Expand Down Expand Up @@ -1310,6 +1311,7 @@ services:
- ${PHRASEANET_THUMBNAILS_DIR}:/var/alchemy/Phraseanet/www/thumbnails:rw
- ${PHRASEANET_CUSTOM_DIR}:/var/alchemy/Phraseanet/www/custom:rw
- ${PHRASEANET_CACHE_DIR}:/var/alchemy/Phraseanet/cache:rw
- ${PHRASEANET_FTP_DIR}:/var/alchemy/Phraseanet/ftp:rw
- ${PHRASEANET_TMP_DIR}:/var/alchemy/Phraseanet/tmp:rw
networks:
- internal
Expand Down Expand Up @@ -1354,6 +1356,7 @@ services:
- ${PHRASEANET_CUSTOM_DIR}:/var/alchemy/Phraseanet/www/custom:rw
- ${PHRASEANET_CACHE_DIR}:/var/alchemy/Phraseanet/cache:rw
- ${PHRASEANET_TMP_DIR}:/var/alchemy/Phraseanet/tmp:rw
- ${PHRASEANET_BACKUP_DIR}:/var/alchemy/Phraseanet/backup:rw
networks:
- internal

Expand Down
8 changes: 6 additions & 2 deletions docker/phraseanet/setup/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@ if [[ ! -f "$FILE" && $PHRASEANET_INSTALL = 1 ]];then
echo `date +"%Y-%m-%d %H:%M:%S"` " - Phraseanet Removing Maintenance Mode"
fi
fi

if [[ -f "$FILE" && $PHRASEANET_UPGRADE = 1 ]];then
timestamp=$(date +'%Y-%m-%d_%H-%M-%S')
timestamp_dir="backup/pre-upgrade/$timestamp"
mkdir -p "$timestamp_dir"
archive_name="$PHRASEANET_HOSTNAME-config.tgz"
tar -zcf "$timestamp_dir/$archive_name" -C "config" .
echo `date +"%Y-%m-%d %H:%M:%S"` " - Pre-upgrade backup done for config $timestamp_dir/$archive_name"
echo `date +"%Y-%m-%d %H:%M:%S"` " - Start Phraseanet upgrade datas"
# TODO check before if an upgrade is require
bin/setup system:upgrade -y
echo `date +"%Y-%m-%d %H:%M:%S"` " - End Phraseanet upgrade datas"
fi
Expand Down

0 comments on commit 02b0445

Please sign in to comment.