Seafile完整环境迁移记录

迁移前环境:

Centos 7 + Seafile + MySQL + Amazon S3 backend

迁移后环境:

一致。

 

迁移前备份:

1、备份数据库。

Ref:https://manual-cn.seafile.com/maintain/backup_recovery.html

mysqldump -h [mysqlhost] -u[username] -p[password] –opt ccnet-db > /backup/databases/ccnet-db.sql.`date +”%Y-%m-%d-%H-%M-%S”`

mysqldump -h [mysqlhost] -u[username] -p[password] –opt seafile-db > /backup/databases/seafile-db.sql.`date +”%Y-%m-%d-%H-%M-%S”`

mysqldump -h [mysqlhost] -u[username] -p[password] –opt seahub-db > /backup/databases/seahub-db.sql.`date +”%Y-%m-%d-%H-%M-%S”`

2、备份配置文件:

关键目录节点:

/conf/

/ccnet/

/pro-data/

/seafile-data/

/seahub-data/custom/

/seafile-server-latest/seahub/media/

/seafile-server-latest/seahub/media/custom/

 

新环境部署:

1、部署MySQL

Ref:https://www.jianshu.com/p/7cccdaa2d177

wget ‘https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm’
rpm -ivh mysql57-community-release-el7-11.noarch.rpm

yum install mysql-community-server

systemctl start mysqld

systemctl enable mysqld

查看密码:

grep ‘temporary password’ /var/log/mysqld.log

修改密码:

mysql_secure_installation

创建账户:

CREATE USER ‘seafile’@’%’ IDENTIFIED BY ‘123456’;

赋予权限:

GRANT ALL ON *.* TO ‘seafile’@’%’;

回灌数据库:

Ref:https://manual-cn.seafile.com/maintain/backup_recovery.html

mysql -u[username] -p[password] ccnet-db < ccnet-db.sql.2013-10-19-16-00-05
mysql -u[username] -p[password] seafile-db < seafile-db.sql.2013-10-19-16-00-20
mysql -u[username] -p[password] seahub-db < seahub-db.sql.2013-10-19-16-01-05

至此MySQL部分配置完毕。

2、安装seafile

Ref:https://manual-cn.seafile.com/deploy/using_mysql.html

# on CentOS 7
yum -y install epel-release
rpm –import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
yum -y install python-imaging MySQL-python python-memcached python-ldap python-urllib3 ffmpeg ffmpeg-devel
pip install pillow moviepy   //没有也行

解压缩出来安装包后:

./setup-seafile-mysql.sh

完全按照指引即可。

注意数据库需要选择“[2] Use existing ccnet/seafile/seahub databases”,然后一步步连接。

安装后数据库会报错,因为已经存在数据,不管,可以起来。

3、回滚旧配置文件目录:

/conf/

/ccnet/

/pro-data/

/seafile-data/

/seahub-data/custom/

/seafile-server-latest/seahub/media/

/seafile-server-latest/seahub/media/custom/

因为安装不完整,需要ln创建一个软连接:

ln -s ./seafile-pro-server-6.x.x ./seafile-server-latest

软连接恢复一个头像和logo的:

ln -s ../../../seahub-data/custom custom

Ref:https://manual-cn.seafile.com/config/seahub_customization.html

 

这时候起业务应该可以起来了。

然后调试,需要进入到系统管理里面,将SERVICE_URL和FILE_SERVER_ROOT临时修改成IP以方便调试。

4、Office依赖安装:

Ref:https://manual-cn.seafile.com/deploy_pro/office_documents_preview.html

yum install libreoffice libreoffice-headless libreoffice-pyuno poppler-utils

yum install wqy-microhei-fonts wqy-zenhei-fonts wqy-unibit-fonts

./seafile.sh restart

《Seafile完整环境迁移记录》上有1条评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注