Tasks:
Jira Legacy |
---|
server | System JIRAJira |
---|
serverId | 3d53374a-bb19-35fe-ac23-1e9b72bdf813 |
---|
key | AAM-1190 |
---|
|
Jira Legacy |
---|
server | System JIRAJira |
---|
serverId | 3d53374a-bb19-35fe-ac23-1e9b72bdf813 |
---|
key | AAM-1188 |
---|
|
Jira Legacy |
---|
server | System JIRAJira |
---|
serverId | 3d53374a-bb19-35fe-ac23-1e9b72bdf813 |
---|
key | AAM-1183 |
---|
|
Jira Legacy |
---|
server | System JIRAJira |
---|
serverId | 3d53374a-bb19-35fe-ac23-1e9b72bdf813 |
---|
key | AAM-1189 |
---|
|
Jira Legacy |
---|
server | System JIRAJira |
---|
serverId | 3d53374a-bb19-35fe-ac23-1e9b72bdf813 |
---|
key | AAM-1181 |
---|
|
...
Code Block |
---|
#!/bin/bash
set -e
docker compose down
if [ "$1" = "backup" ]
then
echo "Taking backup"
docker volume create asta7_am-mongodbdata_backup
docker run --rm -v asta7_am-mongodbdata:/from -v asta7_am-mongodbdata_backup:/to alpine ash -c "cd /from ; cp -av . /to"
fi
sed -i '417s/.*/ test: test $$(echo "rs.initiate().ok || rs.status().ok" | mongo -u $${MONGO_INITDB_ROOT_USERNAME} -p $${MONGO_INITDB_ROOT_PASSWORD} --quiet) -eq 1/g' docker-compose.yml
sed -i 's/MONGO_VERSION=6.0.8/MONGO_VERSION=4.2.3/g' .env
docker compose up -d mongodb
sleep 50
set +e
docker exec -it am-mongodb mongo --username admin --password admin --eval "db.adminCommand({shutdown : 1, force : true})"
set -e
sed -i 's/MONGO_VERSION=4.2.3/MONGO_VERSION=4.4/g' .env
docker compose stop mongodb
docker compose up -d mongodb
sleep 50
docker exec -it am-mongodb mongo --username admin --password admin --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"4.4\" } )"
set +e
docker exec -it am-mongodb mongo --username admin --password admin --eval "db.adminCommand({shutdown : 1, force : true})"
set -e
sed -i 's/MONGO_VERSION=4.4/MONGO_VERSION=5.0.19/g' .env
docker compose stop mongodb
docker compose up -d mongodb
sleep 50
docker exec -it am-mongodb mongo --username admin --password admin --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"5.0\" } )"
set +e
docker exec -it am-mongodb mongo --username admin --password admin --eval "db.adminCommand({shutdown : 1, force : true})"
set -e
sed -i "417s/.*/ test: echo 'db.runCommand\(\"ping\"\).ok' | mongosh -u \$\${MONGO_INITDB_ROOT_USERNAME} -p \$\${MONGO_INITDB_ROOT_PASSWORD} --quiet/g" docker-compose.yml
sed -i 's/MONGO_VERSION=5.0.19/MONGO_VERSION=6.0.8/g' .env
docker compose stop mongodb
docker compose up -d mongodb
sleep 50
docker exec -it am-mongodb mongosh --username admin --password admin --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"6.0\" } )"
docker compose up -d |
How to upgrade:
Warning: This upgrade requires CPU AVX instructions. Attempting to upgrade Asta7 without a CPU that supports AVX may lead to database corruption.
Upgrade to 1.54.0
Go to the asta7 directory and run the following script. If backup is necessary then run the following script with ./asta7-upgrade-1.54.sh backup
View file |
---|
name | asta7-upgrade-1.54.sh |
---|
|
If backup is taken and everything works fine, delete backup
Code Block |
---|
docker volume rm asta7_am-mongodbdata_backup |