安装完成后配置文件在
/opt/jumpserver/config/config.txt
记录 SECRET_KEY 和 BOOTSTRAP_TOKEN
# cat /opt/jumpserver/config/config.txt | egrep "SECRET_KEY|BOOTSTRAP_TOKEN"
迁移请修改 SECRET_KEY 和 BOOTSTRAP_TOKEN 为原来的设置
SECRET_KEY=RUMyMjFENUMtNTA3OC04QTY5LUVBQkMtODQyRDE2MjI1QUIw
BOOTSTRAP_TOKEN=RUMyMjFENUMtNTA3OC04QTY5
RUMyMjFENUMtNTA3OC04QTY5
DB_PASSWORD=ZWMyZDhmODctYjNjZi1iNTk5LW
./opt/jumpserver-installer-v2.16.0/jmsctl.sh backup_db
备份jumpserver数据
cd opt/jumpserver-installer-v2.16.0
./jmsctl.sh backup_db
Backing up...
mysqldump: [Warning] Using a password on the command line interface can be insecure.
[SUCCESS] Backup succeeded! The backup file has been saved to: /opt/jumpserver/db_backup/jumpserver-v2.16.0-2021-12-20_16:24:43.sql
查看备份数据
ll /opt/jumpserver/db_backup/
-rw-r--r-- 1 root root 35386634 Dec 20 16:24 jumpserver-v2.16.0-2021-12-20_16:24:43.sql
还原数据操作
关闭服务
cd /opt/jumpserver-installer-v2.16.3
./jmsctl.sh stop
docker exec -it jms_mysql /bin/bash
# arm64 请使用 $MARIADB_ROOT_PASSWORD
mysql -uroot -p$MYSQL_ROOT_PASSWORD
drop database jumpserver;
create database jumpserver default charset 'utf8';
exit
exit
将备份数据复制到还原目录下
cp /home/ubuntu/jumpserver-v2.16.0-2021-12-20_17_54_05.sql /opt/jumpserver/config/backup/
开始恢复数据
./jmsctl.sh restore_db /opt/jumpserver/config/backup/jumpserver-v2.16.0-2021-12-20_17_54_05.sql
Start restoring database: /opt/jumpserver/config/backup/jumpserver-v2.16.0-2022-03-17.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
[SUCCESS] Database recovered successfully
重启服务
./jmsctl.sh restart
在持久化目录创建 core 目录, 将旧版本录像文件拷贝到持久化目录下面
mkdir -p /opt/jumpserver/core/标签:opt,20,数据,jumpserver,v2.16,config,迁移,Jumpserver,backup From: https://blog.51cto.com/u_11410590/5740676
mv /opt/jumpserver_bak/data /opt/jumpserver/core/