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
15
15
fi
16
16
fi
17
17
18
- BACKUP_DIR=$PREFIX /backup-before-postgres11-migration
19
-
20
18
# If upgrading from a version below 3.13 that has PostgreSQL, and the data dir exists.
21
19
if 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
22
28
if [ -d " $BACKUP_DIR /data" ]; then
23
29
cf_console echo " Old backup in $BACKUP_DIR already exists. Please remove before attempting upgrade."
24
30
exit 1
@@ -125,7 +131,7 @@ if is_upgrade; then
125
131
fi
126
132
fi
127
133
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
129
135
cf_console echo " Moving old data and copying old binaries to $BACKUP_DIR "
130
136
# Now that PostgreSQL is shut down, move the old data out of the way.
131
137
mkdir -p " $BACKUP_DIR /lib"
You can’t perform that action at this time.
0 commit comments