Upgrading an existing Centos v7 system with MariaDB and Nginx was a bit of a nightmare so I thought I’d share the detailed steps I followed. Of course, make sure you’ve got a backup first. Seafile is installed in \data\seafile so change this path as required. Assumes that you’ve used sudo -i to switch to admin/root. The MariaDB upgrade might be optional but I thought what the heck. There are three main gotcha’s with the upgrade:
- Python v3.9.* or higher is needed for Pillow 9.3.* - and this has to be installed by compiling the source code
- Seahub.sh won’t run until the soft link is made between python2.7 and python3
- Seahub.sh won’t start unless djangosaml2 is installed
The last two points are missing from the documentation. #2 is IMO a bug in the install/upgrade process. Pretty sure the upgrade script should do this.
# Stop services.
systemctl stop nginx mariadb
# Backup databases and remove MariaDB.
cp -a /var/lib/mysql/ /var/lib/mysql.bak
yum -y remove mariadb-server mariadb mariadb-libs mariadb-devel
yum clean all
# Install latest MariaDB
chmod +x mariadb_repo_setup
yum -y install mariadb mariadb-server mariadb-devel
systemctl enable mariadb --now
mysql_upgrade -u root -pPASSWORD
# Compile/install Python v3.9.16.
yum -y install gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel
tar -xzvf Python-3.9.16.tgz
rm /usr/src/Python-3.9.16.tgz -f
rm -f /usr/bin/python3 && ln -s /usr/local/bin/python3.9 /usr/bin/python3
rm -f /usr/bin/pip3 && ln -s /usr/local/bin/pip3.9 /usr/bin/pip3
/usr/local/bin/python3.9 -m pip install --upgrade pip
# Install/upgrade modules needed for Seafile v10.x
pip3 install django==3.2.* future==0.18.* mysqlclient==2.1.* pymysql pillow==9.3.* pylibmc captcha==0.4 markupsafe==2.0.1 jinja2 sqlalchemy==1.4.3 psd-tools django-pylibmc django_simple_captcha==0.5.* pycryptodome==3.16.* cffi==1.15.1 lxml djangosaml2 --upgrade
# Upgrade Seafile as usual (see web site). The only thing I’ve not added here is running as a different user. I’m still running as nginx I think. This is only needed for ElasticSearch which client didn’t use.
# Fixup python libraries.
ln -s python2.7 python3
# Start Seafile and Seahub ,crossing fingers and everything else.