confluence迁移,灾难恢复
来源:原创
时间:2021-10-12
作者:脚本小站
分类:Linux
迁移confluence之前要备份confluence数据库和应用数据。
安装mysql:
docker pull mysql:5.7
创建目录:
mkdir /usr/local/docker/mysql/{conf,logs,data} -pv
运行mysql:
duso docker run -p 3306:3306 --name mysql \ -v /usr/local/docker/mysql/conf:/etc/mysql \ -v /usr/local/docker/mysql/logs:/var/log/mysql \ -v /usr/local/docker/mysql/data:/var/lib/mysql \ -e MYSQL_ROOT_PASSWORD=123456 \ -d mysql:5.7
添加账号密码:
docker exec -it mysql bash mysql -uroot -p123456 grant all privileges on *.* to root@'%' identified by "123456"; grant all privileges on *.* to confluence@'%' identified by "confluence";
创建数据库:注意数据库编码格式是特定的,如下。
CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin;
导入之前备份的confluence数据库:
gunzip < confluence.sql.gz | mysql -h192.168.199.65 -P3306 -uroot -p123456 confluence
复制备份的应用数据:
mkdir /var/atlassian/application-data -pv rsync -av --delete --exclude="backups/*" 192.168.199.67:/var/atlassian/application-data/confluence /var/atlassian/application-data/
启动confluence:
docker run --name confluence -d -p 8090:8090 -v /var/atlassian/application-data/confluence:/var/atlassian/application-data/confluence atlassian/confluence-server:6.6.1
复制jdbc驱动到镜像:默认没有集成
docker cp mysql-connector-java-5.1.45-bin.jar confluence:/opt/atlassian/confluence/confluence/WEB-INF/lib
重启confluence:
docker restart confluence
JDBC驱动问题参考地址:
hub.docker.com/r/atlassian/confluence-server/
docker安装MySQL参考:
cnblogs.com/sablier/p/11605606.html
confluence迁移参考地址:
blog.csdn.net/boy298/article/details/78409639