Upgrade from Version 1.4.4 to 1.4.5⚓︎
Note
- Keep SECRET_KEY consistent with the old version during upgrade and migration, otherwise encrypted database data cannot be decrypted.
- Be sure to backup the database and JumpServer source code before updating.
1 Backup Database⚓︎
cp -r /opt/jumpserver /opt/jumpserver_1.4.4_bak
mysqldump -uroot -p jumpserver > /opt/jumpserver_1.4.4.sql
2 Upgrade Steps⚓︎
Note: Please read carefully and understand each step before operating the upgrade
- Check the current version of each component first.
- This document is only applicable to upgrading version 1.4.4.
- Starting from version 1.4.x, MySQL version needs to be greater than or equal to 5.7
- Update the configuration file by copying the old version settings to the new configuration file.
2.1 Stop Core⚓︎
cd /opt/jumpserver
source /opt/py3/bin/activate
./jms stop
- Replace /opt with your actual installation directory.
2.2 Update Code⚓︎
cd /opt/jumpserver
git fetch
git checkout 1.4.5
git pull
If executing git pull prompts an error, handle according to the prompt
- Error: Your local changes to the following file would be overwritten by merge
git reset --hard
git pull
2.3 Update Dependencies⚓︎
pip install -r requirements/requirements.txt
2.4 Handle Upgrade⚓︎
cd utils
vi 1.4.4_to_1.4.5_migrations.sh
#!/bin/bash
#
# Modify database information to your jumpserver database. Can be found in config.py or config.yml
host=127.0.0.1 # Modify to your database
port=3306
username=root # Username
db=jumpserver # Database name
echo "Backup original migrations"
mysqldump -u${username} -h${host} -P${port} -p ${db} django_migrations > django_migrations.sql.bak
ret=$?
if [ ${ret} == "0" ];then
# Execute upgrade script
mysql -u${username} -h${host} -P${port} -p ${db} < 1.4.4_to_1.4.5_migrations.sql
fi
2.5 Start Core⚓︎
cd /opt/jumpserver
source /opt/py3/bin/activate
./jms start
- Ensure there are no errors on startup.
- Then upgrade to the latest version according to the upgrade documentation, otherwise normal use will not be possible.