Upgrade Seafile Server 8 to latest

Hi. I am currently on Seafile 8.0.3 and I would like to upgrade to the latest version. Which upgrade script am I supposed to run or what is the instructions?

I ran minor-upgrade.sh but that didn’t seem to do anything.

Hi @JasperCiti
how and where exactly did you run minor-upgrade.sh? It’s the correct way to go

The upgrade script:

./minor-upgrade.sh

-------------------------------------------------------------
This script would do the minor upgrade for you.
Press [ENTER] to contiune
-------------------------------------------------------------



renaming the gunicorn.conf to gunicorn.conf.py ...

Done

------------------------------
migrating avatars ...


DONE
------------------------------


Moving the elasticsearch's configuration file ...


updating seafile-server-latest symbolic link to /opt/seafile/seafile-server-8.0.7 ...

DONE
------------------------------

When I restart:

/opt/seafile/seafile-server-8.0.7# ./seahub.sh start

LANG is not set in ENV, set to en_US.UTF-8
LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 ...

Error happened during creating seafile admin.

Error:Seahub failed to start.
Please try to run "./seahub.sh start" again

The seahub.log:

Traceback (most recent call last):
  File "/opt/seafile/seafile-server-8.0.3/seahub/thirdpart/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/opt/seafile/seafile-server-8.0.3/seahub/thirdpart/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/opt/seafile/seafile-server-8.0.3/seahub/thirdpart/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/seafile/seafile-server-8.0.3/seahub/thirdpart/django/utils/decorators.py", line 142, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/opt/seafile/seafile-server-8.0.3/seahub/thirdpart/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/opt/seafile/seafile-server-8.0.3/seahub/seahub/auth/views.py", line 121, in login
    if form.is_valid():
  File "/opt/seafile/seafile-server-8.0.3/seahub/thirdpart/django/forms/forms.py", line 185, in is_valid
    return self.is_bound and not self.errors
  File "/opt/seafile/seafile-server-8.0.3/seahub/thirdpart/django/forms/forms.py", line 180, in errors
    self.full_clean()
  File "/opt/seafile/seafile-server-8.0.3/seahub/thirdpart/django/forms/forms.py", line 382, in full_clean
    self._clean_form()
  File "/opt/seafile/seafile-server-8.0.3/seahub/thirdpart/django/forms/forms.py", line 409, in _clean_form
    cleaned_data = self.clean()
  File "/opt/seafile/seafile-server-8.0.3/seahub/seahub/auth/forms.py", line 59, in clean
    self.user_cache = authenticate(username=username,
  File "/opt/seafile/seafile-server-8.0.3/seahub/seahub/auth/__init__.py", line 56, in authenticate
    user = backend.authenticate(**credentials)
  File "/opt/seafile/seafile-server-8.0.3/seahub/seahub/base/accounts.py", line 576, in authenticate
    user = self.get_user(username)
  File "/opt/seafile/seafile-server-8.0.3/seahub/seahub/base/accounts.py", line 570, in get_user
    user = self.get_user_with_import(username)
  File "/opt/seafile/seafile-server-8.0.3/seahub/seahub/base/accounts.py", line 541, in get_user_with_import
    emailuser = seaserv.get_emailuser_with_import(username)
  File "/opt/seafile/seafile-server-8.0.3/seafile/lib64/python3.6/site-packages/seaserv/service.py", line 125, in get_emailuser_with_import
    return ccnet_threaded_rpc.get_emailuser_with_import(email)
  File "/opt/seafile/seafile-server-8.0.3/seafile/lib64/python3.6/site-packages/pysearpc/client.py", line 126, in newfunc
    ret_str = self.call_remote_func_sync(fcall_str)
  File "/opt/seafile/seafile-server-8.0.3/seafile/lib64/python3.6/site-packages/pysearpc/named_pipe.py", line 100, in call_remote_func_sync
    transport = self._get_transport()
  File "/opt/seafile/seafile-server-8.0.3/seafile/lib64/python3.6/site-packages/pysearpc/named_pipe.py", line 90, in _get_transport
    transport = self._create_transport()
  File "/opt/seafile/seafile-server-8.0.3/seafile/lib64/python3.6/site-packages/pysearpc/named_pipe.py", line 83, in _create_transport
    transport.connect()
  File "/opt/seafile/seafile-server-8.0.3/seafile/lib64/python3.6/site-packages/pysearpc/named_pipe.py", line 47, in connect
    self.pipe.connect(self.socket_path)
ConnectionRefusedError: [Errno 111] Connection refused
2021-10-01 14:31:10,855 [WARNING] django.request:222 log_response Not Found: /favicon.ico

I assume you have seafile.sh started when seahub.sh fails. In my case seafile.sh does not create $server_path/runtime/seafile.sock even when running so seahub fails to create admin account and to start.
Im doing a fresh install btw.

I don’t want to loose my files. I have GBs of encrypted files and I am afraid that a fresh installation would generate different encryption keys.

I also wonder about the upgrade. I have downloaded and extracted the newest server version as usual. But for this minor upgrade it says in the manual before running the upgrade script:

For this type of upgrade, you only need to update the symbolic links (for avatar and a few other folders).

But there is no explanation how to do so. I googled some symbolic link guides but I was not successful in changing the symbolic link.

EDIT: Found out that the upgrade script does the whole work. Cool! Upgrade smooth as usual.

EDIT2: I always found this guide useful HowTo: Update Seafile Server for generic Linux to version 7.1.5 64bit - My little Farm
I remember once I had upgrade issues and then these instructions helped:

Revise the file system permissions:
chown seafile:root /opt/seafile/ -R (takes ages)

Clear the Seahub cache:
rm -rf /tmp/seahub_cache
systemctl restart memcached

ls -l
total 40
drwx------ 2 seafile seafile 4096 Jan 28  2021 ccnet
drwx------ 3 seafile seafile 4096 Jan 28  2021 conf
drwxr-xr-x 2 seafile seafile 4096 Oct  3 20:18 installed
drwxr-xr-x 2 seafile seafile 4096 Oct  1 16:34 logs
drwxr-xr-x 2 seafile seafile 4096 Oct  3 20:15 pids
drwxr-xr-x 4 root    root    4096 Feb  1  2021 seafile-cli
drwx------ 7 seafile seafile 4096 Jan 28  2021 seafile-data
drwxr-xr-x 7 seafile seafile 4096 Jan 26  2021 seafile-server-8.0.3
drwxr-xr-x 7 seafile seafile 4096 Aug  9 04:57 seafile-server-8.0.7
lrwxrwxrwx 1 root    root      20 Oct  1 16:46 seafile-server-latest -> seafile-server-8.0.7
drwxrwxr-x 4 seafile seafile 4096 Jan 29  2021 seahub-data

Yet, from the logs it seems like it still tries to startup 8.0.3

Turns out seafile-server-8.0.3 was already running and prevented the new one from starting up. I guess it is because the symbolic link changed with the upgrade script the old one doesn’t shutdown because systemctl points to a different location. Also the scripts didn’t stop it, probably because I was running the scripts as seafile user and the old one started with the system user or something. I had to kill the old server, now the new one starts. Would have been nice if the logs could give some better errors to indicate that the port was already used or something.