Skip to content

Commit

Permalink
Merge pull request #5837 from Countly/fix/upgrade-script-2412
Browse files Browse the repository at this point in the history
fixed mongo7 and 2412 upgrade scripts
  • Loading branch information
ArtursKadikis authored Dec 4, 2024
2 parents 8694bf0 + 50e935e commit 36014f5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
9 changes: 9 additions & 0 deletions bin/upgrade/24.12/upgrade.mongo.70.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ if [ -f /etc/redhat-release ]; then
systemctl daemon-reload
fi

# check and comment out journal: enabled: true in mongod.conf
CONF_FILE="/etc/mongod.conf"
if grep -qP '^\s*journal\s*:\s*$' "$CONF_FILE" && grep -qP '^\s*enabled\s*:\s*true\s*$' "$CONF_FILE"; then
echo "Commenting out journal: enabled: true in $CONF_FILE"
sed -i '/^\s*journal\s*:/ { N; s/\(.*\n\s*\)\(enabled\s*:\s*true\s*$\)/# \1# \2/ }' "$CONF_FILE"
else
echo "Could not find 'journal: enabled: true' in $CONF_FILE or it's already commented."
fi

#mongodb might need to be started
systemctl restart mongod || echo "mongodb systemctl job does not exist"

Expand Down
4 changes: 2 additions & 2 deletions bin/upgrade/24.12/upgrade_db.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

VER="24.10"
VER="24.12"

CONTINUE="$(countly check before upgrade db "$VER")"

Expand All @@ -22,8 +22,8 @@ then

if [ "$1" != "combined" ]; then
#upgrade plugins
countly plugin enable journey_engine;
countly plugin enable content;
countly plugin enable journey_engine;
nodejs "$DIR/scripts/install_plugins.js"
fi

Expand Down
4 changes: 2 additions & 2 deletions bin/upgrade/24.12/upgrade_fs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

echo "Running filesystem modifications"

VER="24.10"
VER="24.12"

CONTINUE="$(countly check before upgrade fs "$VER")"

Expand All @@ -23,8 +23,8 @@ then
#enable command line
bash "$DIR/scripts/detect.init.sh"

countly plugin enable journey_engine;
countly plugin enable content;
countly plugin enable journey_engine;

#upgrade plugins
nodejs "$DIR/scripts/install_plugins.js"
Expand Down

0 comments on commit 36014f5

Please sign in to comment.