Skip to content

Commit 3d72a2d

Browse files
author
Aleksei Shpakovskii
committed
ENT-4242 Error out only if actual backup exists in $BACKUP_DIR
Let users redirect this dir to another drive. Also show backup destination to let users reconsider.
1 parent 5f333b0 commit 3d72a2d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packaging/common/cfengine-hub/preinstall.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ BACKUP_DIR=$PREFIX/backup-before-postgres10-migration
1919

2020
# If upgrading from a version below 3.12 that has PostgreSQL, and the data dir exists.
2121
if is_upgrade && egrep '^3\.([6-9]|1[01])\.' "$PREFIX/UPGRADED_FROM.txt" >/dev/null && [ -d "$PREFIX/state/pg/data" ]; then
22-
if [ -d "$BACKUP_DIR" ]; then
22+
if [ -d "$BACKUP_DIR/data" ]; then
2323
cf_console echo "Old backup in $BACKUP_DIR already exists. Please remove before attempting upgrade."
2424
exit 1
2525
fi
2626
cf_console echo "Attempting to migrate Mission Portal database. This can break stuff."
27+
cf_console echo "Copy will be created in $BACKUP_DIR dir."
2728
cf_console echo "It can be disabled by shutting down CFEngine and removing/renaming $PREFIX/state/pg/data prior to upgrade."
2829
cf_console echo "Press Ctrl-C in the next 15 seconds if you want to cancel..."
2930
sleep 15

0 commit comments

Comments
 (0)