Seafile won't start after recreating docker image

I modified the configuration of my seafile docker image (removed a port) and re-created the image. The problem is that the server won’t start now. This is the error:

*** Running /etc/my_init.d/

*** Booting runit daemon...

*** Runit started as PID 24

*** Running /scripts/

[09/03/2021 22:23:01][upgrade]: The container was recreated, running to fix the media symlinks

[09/03/2021 22:23:01][upgrade]: Running script /opt/seafile/seafile-server-8.0.3/upgrade/

[2021-09-03 22:23:01] Skip running because there is existing seafile-data folder.

Traceback (most recent call last):

  File "/scripts/", line 86, in <module>


  File "/scripts/", line 58, in main


  File "/scripts/", line 169, in check_upgrade


  File "/scripts/", line 80, in fix_media_symlinks


  File "/scripts/", line 84, in run_minor_upgrade

    run_script_and_update_version_stamp(minor_upgrade_script, current_version)

  File "/scripts/", line 60, in run_script_and_update_version_stamp

    replace_file_pattern(script, 'read dummy', '')

  File "/scripts/", line 295, in replace_file_pattern

    with open(fn, 'r') as fp:

FileNotFoundError: [Errno 2] No such file or directory: '/opt/seafile/seafile-server-8.0.3/upgrade/'

*** /scripts/ exited with status 1.

*** Shutting down runit daemon (PID 24)...

*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...

*** Killing all processes...

I’m not sure what to do now. If I recreate the image how do I get the data back?

I’d recommend starting your container it using a different endpoint, e.g. /bin/bash
Then you can go see what’s in /opt/seafile – you can check to be sure that the seafile-server-8.0.3 directory exists: what’s the output of ls -al from /opt/seafile down to /opt/seafile/seafile-server-8.0.3/upgrade/

The default endpoint restarts seahub container over and over if anything goes wrong. If you feel like recreating it, I can give you some hints to making the command to start it set in docker-compose.yml

I would really like to know how to re-install the container and keep the data. I ended up deleting everything and re-uploading all the data that I had on a computer. But that’s not very practical.

Thats doable, I rebuild my containers all the time without data loss, the real difficult part with the current docker (which is all derived from raw iron installs) is that so much is put in to try and guess - I’ve spent a lot of time going through and tracing the startup and upgrade scripts. IMHO it all needs rewritten… which I’ve been doing slightly for my own use. That’s less than ideal.