paapereira.xyz

Upgrading Seafile from 7.0.x to 7.1.x

cover

I’ve waiting to upgrade to Seafile 7.1 because I keep my installation manually and I wasn’t finding the *x86-64.tar.gz option to download. After asking in the forums, I discovered it’s just a change of name.

Don’t forget to read the release notes from Seafile.

Before upgrading

Reading the release notes, this version needs Python 3 and a set of modules.

Python 3

1yay -S python python-setuptools python-pip
2
3sudo pip3 install --timeout=3600 wheel Pillow pylibmc captcha jinja2 \
4	sqlalchemy django-pylibmc django-simple-captcha python3-ldap \
5	django-recaptcha django-ranged-response

Memcached

The Memcached configuration also changed in this version. I wasn’t using Memcached, so I took the opportunity to set it up.

1yay -S memcached libmemcached
1sudo systemctl edit memcached.service --full
1Environment=CACHESIZE=128
1sudo systemctl enable memcached
2sudo systemctl start memcached
3sudo systemctl status memcached
1vi conf/seahub_settings.py
1CACHES = {
2	'default': {
3		'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
4		'LOCATION': '127.0.0.1:11211',
5	},
6	'locmem': {
7		'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
8	},
9}

Upgrading

I started by stopping the services:

1sudo systemctl stop seahub
2sudo systemctl stop seafile

Then I downloaded the latest version (I use the pro version) and executed the upgrade script.

1sudo -u seafile -s /bin/sh
2
3cd /srv/seafile
4wget "https://download.seafile.com/d/xxxxxxx/files/?p=/pro/seafile-pro-server_7.1.5_x86-64_CentOS.tar.gz&dl=1" -O seafile-pro-server_7.1.5_x86-64_CentOS.tar.gz
5tar -xzf seafile-pro-server_*
6
7cd seafile-pro-server-7.1.5/
8upgrade/upgrade_7.0_7.1.sh

Upgrade failed

The upgrade script was failing with syntax errors. I thought it was something to do with the Python 3 migration, but after some digging around I found out that the problem was in the fact that my mysql password had a ‘%’ 😐

I changed the password, reviewed the configuration files to update de password, re-executed the upgrade script and… success.

1mysql -u root -p
2
3use mysql;
4SET PASSWORD FOR 'seafile_user'@'localhost' = PASSWORD('newpass');

Configuration files to review the mysql password:

Clean Seahub cache

1rm -rf /tmp/seahub_cache/
2sudo systemctl restart memcached

Review seafile webdav configuration

1cd /etc/httpd/conf
2sudo vi extra/httpd-vhosts.conf
1<Location /seafdav>
2  ProxyPass "http://127.0.0.1:8080/seafdav"
3</Location>

Starting the services

1sudo systemctl start seafile
2sudo systemctl start seahub

And… seahub didn’t start.

After much digging around I found out that the problem was in some python modules.

Some tips om how I debugged the problem:

To start seahub mannualy change the daemon option in the gunicorn.conf.py file:

1sudo systemctl stop seafile
2vi conf/gunicorn.conf.py
1daemon = False
1seafile-server-latest/seahub.sh start

I had to manually remove 2 python modules and re-installed them via pip:

1sudo mv /usr/lib/python3.8/site-packages/django_pylibmc* /tmp
2sudo mv /usr/lib/python3.8/site-packages/django_simple_captcha-0.5.12.dist-info /tmp
3sudo pip3 install --timeout=3600 django-pylibmc django-simple-captcha

Don’t forget to change the daemon config again:

1vi conf/gunicorn.conf.py
1daemon = True

And voilá:

1sudo systemctl start seafile
2sudo systemctl start seahub

#Linux #Arch Linux #Seafile