原系统 Windows server 2008 R2 Seafile Server 6.0.7 32bit 容量400GB
分别将 6.0.7 6.1.2 6.2.5 6.3.4 7.0.5 7.1.5 8.0.8 9.0.6 版本下载下来。
测试升级第一大坑,全局代理,因为我的服务器环境默认是不能上网的,只能通过代理上网去更新或者安装软件,设置了代理后启动Seafile Server 会导致建立缩略图 thumbnail 及预览问题
错误信息: [ERROR] seahub.thumbnail.utils:149 generate_thumbnail HTTP Error 503: Service Unavailable
在无意中发现这个问题后正式开始升级。
1 Win Seafile Server 6.0.7(Sqlite) 32bit TO CentOS 7 Seafile 6.0.7 64bit(Sqlite)
参考文档:
https://cloud.seafile.com/published/seafile-manual-cn/deploy_windows/migrate_from_win_to_linux.md
需要注意的是 seahub_settings.py seahub_settings.pyc 放在Linux conf/下面
2 CentOS 7 Seafile Server 6.0.7 sqlite to MariaDB 5.5
参考文档:
https://cloud.seafile.com/published/seafile-manual-cn/deploy/migrate_from_sqlite_to_mysql.md
3 在 CentOS 7 下 Seafile 6.0.7 6.1.2 6.2.5 6.3.4 7.0.5 7.1.5 8.0.8 一个个版本升级
参考文档,安装对应版本组件
https://cloud.seafile.com/published/seafile-manual-cn/deploy/using_mysql.md
在6.3.4 升级到 7.0.5 时会报如下错误,看了官方说明这是专业版和CE版同一个升级脚本所报的错,不用管即可。
Updating seafile/seahub database …
[INFO] You are using MySQL
[INFO] updating ccnet database…
[INFO] updating seafile database…
[INFO] updating seahub database…
[WARNING] Failed to execute sql: (1146, “Table ‘seahub-db.TotalStorageStat’ doesn’t exist”)
[WARNING] Failed to execute sql: (1146, “Table ‘seahub-db.TotalStorageStat’ doesn’t exist”)
[WARNING] Failed to execute sql: (1146, “Table ‘seahub-db.TotalStorageStat’ doesn’t exist”)
[WARNING] Failed to execute sql: (1146, “Table ‘seahub-db.TotalStorageStat’ doesn’t exist”)
[WARNING] Failed to execute sql: (1146, “Table ‘seahub-db.FileOpsStat’ doesn’t exist”)
[WARNING] Failed to execute sql: (1146, “Table ‘seahub-db.FileOpsStat’ doesn’t exist”)
[WARNING] Failed to execute sql: (1146, “Table ‘seahub-db.UserActivityStat’ doesn’t exist”)
[WARNING] Failed to execute sql: (1146, “Table ‘seahub-db.UserActivityStat’ doesn’t exist”)
[WARNING] Failed to execute sql: (1146, “Table ‘seahub-db.UserActivityStat’ doesn’t exist”)
[WARNING] Failed to execute sql: (1146, “Table ‘seahub-db.UserActivityStat’ doesn’t exist”)
[WARNING] Failed to execute sql: (1146, “Table ‘seahub-db.UserActivityStat’ doesn’t exist”)
[WARNING] Failed to execute sql: (1051, “Unknown table ‘UserTrafficStat’”)
[WARNING] Failed to execute sql: (1091, “Can’t DROP ‘profile_profile_contact_email_0975e4bf_uniq’; check that column/key exists”)
Done
因为我没有使用Nginx Apache ,所以在6.3.4升级到 7.0.5 需要修 /conf/gunicorn.conf.py bind = “0.0.0.0:8000”,如果是用Nginx Apache就不需要修改。
7.0.5 升级 7.1.5 需要安装Python3环境 及相关组件,跟文档操作。会在安装python组件时报错,只需要升级setuptools pip3 版本即可。
7.1.5 - 8.0.8 平稳升级。
Seafile Server 9.0 不支持CentOS 建立一台Ubunt 22.04
pylibmc 报错 安装 libmemcached-dev
4 迁移至 Ubuntu 22.04
在Ubuntu环境下安装MariaDB ,建立好数据库,建立好SQL的Seafile用户,再从CentOS下dump seafile 的数据库, 然后在Ubuntu下恢复所有的数据库。
因为在虚拟服务器,只需要把CentOS第二个硬盘文件Move到Ubuntu目录上(这里要说明的是最开始的系统我建立两个硬盘,一个是系统,一个是给SeafileServer使用),再挂上就可以使用了。修改conf/seafile.conf ccnet.conf seahub_settings.py 里面数据库的用户密码即可启动。
5 Ubuntu 22.04 Upgrad Seafile Server 8.0.8 → 9.0.6
在ubuntu 22.04 升级完9.0.6 后,起动 seahub无法起动,会报以下错:
Exception: Version mismatch: this is the ‘cffi’ package version 1.14.0, located in ‘/data/seafile-server-9.0.6/seahub/thirdpart/cffi/api.py’. When we import the top-level ‘_cffi_backend’ extension module, we get version 1.15.0, located in ‘/usr/lib/python3/dist-packages/_cffi_backend.cpython-310-x86_64-linux-gnu.so’. The two versions should be equal; check your installation.
Error:Seahub failed to start.
在老外的论坛上找到了解决方式,如下:
pip3 install --force-reinstall --upgrade --target /seafile-server-9.0.6/seahub/thirdpart cffi==1.14.6
安装cffi也报错,安装 libffi-dev解决。
升级后安装Nginx ,改用HTTPS,配置一下自动启动,升级完成。