File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
packaging/common/cfengine-hub Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,16 @@ if is_upgrade; then
1515 fi
1616fi
1717
18- BACKUP_DIR=$PREFIX /backup-before-postgres11-migration
19-
2018# If upgrading from a version below 3.13 that has PostgreSQL, and the data dir exists.
2119if is_upgrade && egrep ' ^3\.([6-9]|1[012])\.' " $PREFIX /UPGRADED_FROM.txt" > /dev/null && [ -d " $PREFIX /state/pg/data" ]; then
20+ alias migrating_postgres=' true'
21+ else
22+ alias migrating_postgres=' false'
23+ fi
24+
25+ BACKUP_DIR=$PREFIX /backup-before-postgres11-migration
26+
27+ if migrating_postgres; then
2228 if [ -d " $BACKUP_DIR /data" ]; then
2329 cf_console echo " Old backup in $BACKUP_DIR already exists. Please remove before attempting upgrade."
2430 exit 1
@@ -125,7 +131,7 @@ if is_upgrade; then
125131 fi
126132fi
127133
128- if is_upgrade && egrep ' ^3\.([6-9]|1[01])\. ' " $PREFIX /UPGRADED_FROM.txt " > /dev/null && [ -d " $PREFIX /state/pg/data " ] ; then
134+ if migrating_postgres ; then
129135 cf_console echo " Moving old data and copying old binaries to $BACKUP_DIR "
130136 # Now that PostgreSQL is shut down, move the old data out of the way.
131137 mkdir -p " $BACKUP_DIR /lib"
You can’t perform that action at this time.
0 commit comments