Skip to content

Commit 7c515c8

Browse files
author
Aleksei Shpakovskii
committed
ENT-4242 Upgrade Postgres version in migration scripts to Postgres 10
Now we will require DB migration when upgrading from all CFEngine versions, including 3.12.x
1 parent 6fd2124 commit 7c515c8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packaging/common/cfengine-hub/postinstall.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ generate_new_postgres_conf() {
376376
}
377377

378378
#POSTGRES RELATED
379-
BACKUP_DIR=$PREFIX/backup-before-postgres10-migration
379+
BACKUP_DIR=$PREFIX/backup-before-postgres11-migration
380380
if [ ! -d $PREFIX/state/pg/data ]; then
381381
mkdir -p $PREFIX/state/pg/data
382382
chown -R cfpostgres $PREFIX/state/pg

packaging/common/cfengine-hub/preinstall.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ if is_upgrade; then
1515
fi
1616
fi
1717

18-
BACKUP_DIR=$PREFIX/backup-before-postgres10-migration
18+
BACKUP_DIR=$PREFIX/backup-before-postgres11-migration
1919

20-
# If upgrading from a version below 3.12 that has PostgreSQL, and the data dir exists.
21-
if is_upgrade && egrep '^3\.([6-9]|1[01])\.' "$PREFIX/UPGRADED_FROM.txt" >/dev/null && [ -d "$PREFIX/state/pg/data" ]; then
20+
# If upgrading from a version below 3.13 that has PostgreSQL, and the data dir exists.
21+
if is_upgrade && egrep '^3\.([6-9]|1[012])\.' "$PREFIX/UPGRADED_FROM.txt" >/dev/null && [ -d "$PREFIX/state/pg/data" ]; then
2222
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

0 commit comments

Comments
 (0)