Posts tagged with seafile

有以下几个步骤:

  1. 备份数据库
    可利用phpmyadmin或者mysqldump备份
  2. 备份文件
    将/opt/seafile文件夹打包压缩
  3. 数据库迁移
    在新服务器建立数据库,导入备份文件
  4. 文件迁移
    在新服务器建立文件夹/opt,将备份文件下载后,解压缩
  5. 在新服务器启动
    查看/opt/seafile/conf/下的配置文件
    seahub_settings.py、seafile.conf、ccnet.conf等
    确保数据库用户名、密码和数据库是正确的。
  6. 注意文件夹权限
    新建用于seafile,将/opt/seafile所有文件更改用户为seafile
    然后在/opt/seafile/seafile-server-latest/下启动
    ./seafile.sh start
    ./seahub.sh start

问题:

  1. 如果遇到seahub启动失败,需要将/opt/seafile/conf/gunicorn.py中的deamon 修改为False可以查看错误信息。
    例如错误信息为:On line 25, AVATAR_RESIZE_METHOD = getattr(settings, 'AVATAR_RESIZE_METHOD', Image.ANTIALIAS) 之类的,
    需要将文件中的getattr(settings, 'AVATAR_RESIZE_METHOD', Image.ANTIALIAS) 修改为getattr(settings, 'AVATAR_RESIZE_METHOD', None),然后保存
    继续讲deamon修改为True,保存。
    启动seahub.sh 一切正常。

参考文件:https://forum.seafile.com/t/seahub-wont-start-and-it-not-gives-any-useful-input-about-why/18535/5

sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip libmysqlclient-dev ldap-utils libldap2-dev
sudo apt-get install -y memcached libmemcached-dev
sudo pip3 install --timeout=3600 django==3.2. future==0.18. mysqlclient==2.1. \ pymysql pillow==10.0. pylibmc captcha==0.4 markupsafe==2.0.1 jinja2 sqlalchemy==2.0.18 \ psd-tools django-pylibmc django_simple_captcha==0.5. djangosaml2==1.5. pysaml2==7.2. pycryptodome==3.16. cffi==1.15.1 lxml python-ldap==3.4.3

Above is the solution, it seems after upgrade, some python libraries are missing, just re-install these libraries and

su seafile
./seafile.sh start

Everything gets back to normal.

After upgrade seafile server to a newer version, i.e., from 8.0.X to 10.0.X, when starting "./seahub.sh start", if "Error happened during creating seafile admin" is found, here is the solution,

It is most likely caused by the user group of the directory and files,
for example, when your seafile server is located at /opt/seafile,
you should change user of all directories under this directory to seafile

chown seafile:seafile /opt/seafile -R

Then run run the bash

./seahub.sh start

Problem will be solved.

Reference,
https://www.0z.gs/seafile/1733.html