Upgrade 5.0.4 to 6.x and server move

I think i need some advise about upgrade.
I can’t run an in place upgrade because my server OS is too old and the machine is going to be decommissioned. So I am going to install on a new machine.
Old machine is on CentOS6
New machine is Debian 9

What’s the right procedure?
Should I first install 5.0.4 on the new machine, copy the data over and then upgrade on the new machine?
Or can I install latest version right away, copy the data over and then run all the upgrade scripts?
Or…

thanks a lot for advise!

Yes that will work. Using mrsync can speedup moving data to the new host.
Don’t forget to dumb the DB after shutdown of Seafile on the old node.
Running GC on the old node before moving data might also make sense, since it will remove data that isn’t required anymore.

Thanks!
I gave that a dry-run and it seems to work, except I am seeing tons of erros in seahub.log like these:

 OperationalError: (1054, "Unknown column 'api2_tokenv2.created_at' in 'field list'")
    2019-05-27 18:50:09,291 [ERROR] seahub.api2.endpoints.admin.sysinfo:127 get (1054, "Unknown column 'api2_tokenv2.wiped_at' in 'where clause'")
    2019-05-27 18:50:09,293 [ERROR] seahub.api2.endpoints.admin.sysinfo:135 get (1054, "Unknown column 'api2_tokenv2.wiped_at' in 'where clause'")
    2019-05-27 18:50:45,293 [ERROR] seahub.api2.endpoints.admin.sysinfo:127 get (1054, "Unknown column 'api2_tokenv2.wiped_at' in 'where clause'")
    2019-05-27 18:50:45,295 [ERROR] seahub.api2.endpoints.admin.sysinfo:135 get (1054, "Unknown column 'api2_tokenv2.wiped_at' in 'where clause'")
    2019-05-27 18:50:56,418 [ERROR] seahub.api2.endpoints.admin.sysinfo:127 get (1054, "Unknown column 'api2_tokenv2.wiped_at' in 'where clause'")
    2019-05-27 18:50:56,420 [ERROR] seahub.api2.endpoints.admin.sysinfo:135 get (1054, "Unknown column 'api2_tokenv2.wiped_at' in 'where clause'")
    2019-05-27 18:51:30,512 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api2/devices/
    Traceback (most recent call last):
      File "/opt/seafile/seafile-server-6.3.4/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
      File "/opt/seafile/seafile-server-6.3.4/seahub/thirdpart/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
      File "/opt/seafile/seafile-server-6.3.4/seahub/thirdpart/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
      File "/opt/seafile/seafile-server-6.3.4/seahub/thirdpart/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
      File "/opt/seafile/seafile-server-6.3.4/seahub/thirdpart/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
      File "/opt/seafile/seafile-server-6.3.4/seahub/thirdpart/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
      File "/opt/seafile/seafile-server-6.3.4/seahub/seahub/api2/base.py", line 23, in dispatch
    response = super(APIView, self).dispatch(*a, **kw)
      File "/opt/seafile/seafile-server-6.3.4/seahub/thirdpart/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
      File "/opt/seafile/seafile-server-6.3.4/seahub/seahub/api2/base.py", line 20, in handle_exception
    return super(APIView, self).handle_exception(exc)
      File "/opt/seafile/seafile-server-6.3.4/seahub/thirdpart/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
      File "/opt/seafile/seafile-server-6.3.4/seahub/seahub/api2/views.py", line 2517, in get
    devices = TokenV2.objects.get_user_devices(username)

thanks for any help!

make sure you ran all needed upgrade scripts.
as your database is missing coloumns

1 Like

did that. the update scripts were throwing some errors though like columns already exist and such.
Do the upgrade scripts write any logs?

There were times where one had to update the dB manually because of missing columns.
You could also try to load the initial DB template and see if this fixes it. Another dump before trying that is advisable.

Just to give you some feedback that the server migration went well last night. Everything running fine on the new server. Only issue I see is a regular warning in seahub.log:
[WARNING] django.request:152 get_response Not Found: /ajax/unseen-notices-count/
Any hint how to solve that is appreciated.

Thanks for all your input so far!

1 Like

No idea sorry. Maybe open another thread