Docker migration from 10 to 11 fails on migration script

Hi!

At long last I migrated my server from v9 running franchetti’s docker image and using sqlite, to v10 using the official docker image and mysql + memcached. It was a lot of work bringing the data and configuration back to the correct setup, but v10 is now working. I did not take any particular steps to migrate the data after following the sqlite migration instructions to fill the Mysql database (I had to trop previous sessions and login logs due to hacking attempts resulting in corrupted SQL scripts). I simply ran v10 directly, connecting it to the populated Mysql. It worked, if any migration happened it seems to have done so silently and successfully. I do have some errors in the seahub log but this could be related to my reverse proxy not forwarding some of the newer things like notifications etc., I’m not sure. The functionality I’m used to is there.

But now I thought I’m ready to simply stop the Docker container, replace the version number and relaunch. However this fails. The logs of the docker container say:

2024-05-14T18:13:58.831542215Z *** Running /etc/my_init.d/01_create_data_links.sh...
2024-05-14T18:13:58.928023433Z *** Booting runit daemon...
2024-05-14T18:13:58.928071609Z *** Runit started as PID 25
2024-05-14T18:13:58.928465435Z *** Running /scripts/enterpoint.sh...
2024-05-14T18:13:59.007091183Z 2024-05-14 20:13:59 Nginx ready 
2024-05-14T18:13:59.069816784Z 2024-05-14 20:13:59 This is an idle script (infinite loop) to keep container running. 
2024-05-14T18:13:59.501629845Z [2024-05-14 20:13:59] Skip running setup-seafile-mysql.py because there is existing seafile-data folder.
2024-05-14T18:13:59.502328846Z [05/14/2024 20:13:59][upgrade]: The container was recreated, start fix the media symlinks
2024-05-14T18:13:59.507076735Z mv: cannot stat '/opt/seafile/seafile-server-10.0.1/seahub/media/avatars/*': No such file or directory
2024-05-14T18:13:59.507866416Z Traceback (most recent call last):
2024-05-14T18:13:59.507904620Z   File "/scripts/start.py", line 95, in <module>
2024-05-14T18:13:59.508214288Z     main()
2024-05-14T18:13:59.508232673Z   File "/scripts/start.py", line 61, in main
2024-05-14T18:13:59.508413200Z     check_upgrade()
2024-05-14T18:13:59.508429702Z   File "/scripts/upgrade.py", line 120, in check_upgrade
2024-05-14T18:13:59.508709310Z     fix_media_symlinks()
2024-05-14T18:13:59.508727631Z   File "/scripts/upgrade.py", line 104, in fix_media_symlinks
2024-05-14T18:13:59.508920138Z     call('mv -n %s/* %s' % (avatars_dir, dst_avatars_dir))
2024-05-14T18:13:59.508937203Z   File "/scripts/utils.py", line 70, in call
2024-05-14T18:13:59.509198182Z     return subprocess.check_call(*a, **kw)
2024-05-14T18:13:59.509217175Z   File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
2024-05-14T18:13:59.509583923Z     raise CalledProcessError(retcode, cmd)
2024-05-14T18:13:59.509616856Z subprocess.CalledProcessError: Command 'mv -n /opt/seafile/seafile-server-10.0.1/seahub/media/avatars/* /shared/seafile/seahub-data/avatars' returned non-zero exit status 1.

To me this seems like it was obviously going to fail, since the new image contains:

  • the seafile-server-11.0.8 directory
  • the seafile-server-latest symlink which points to seafile-server-10.0.1
  • but no seafile-server-10.0.1 folder anymore, it was in the previous image I guess

What have I done wrong and what should I do now? Would running upgrade_10.0_11.0.sh manually from within the container help? I prefer to ask before attempting…

Fortunately for now, going back to version 10 still works so I can wait a few days without losing my data. But I’d be keen on moving to the latest version!

Thanks in advance for your insights,
P.