Error when moving docker container


#1

I have been running seafile in docker for a while now without any trouble. I run nightly backups that I setup using the official documentation. I am in the process of replacing my docker host server and have moved most of my containers with no trouble by just moving the volume data and recreating the containers. I cannot however get my new seafile container to work.
I created a new container using the same settings as my old system. Then ran the following commands to import the database and retrieve my backed up data.

docker exec -it seafile /bin/sh -c “mysql -uroot ccnet_db < /shared/ccnet_db.sql”
docker exec -it seafile /bin/sh -c “mysql -uroot seafile_db < /shared/seafile_db.sql”
docker exec -it seafile /bin/sh -c “mysql -uroot seahub_db < /shared/seahub_db.sql”

rsync -a /mnt/seafile_backups/data/seafile/ /DockerStorage/volumes/seafile/_data/seafile/

Then when I restart the container I get the following error in the docker logs and it never starts.
** Message: seafile-controller.c(1155): loading seafdav config from /opt/seafile/conf/seafdav.conf

failed to run “ccnet-server -t”
[04/22/19 18:07:45] …/common/session.c(143): using config file /opt/seafile/conf/ccnet.conf
[04/22/19 18:07:45] …/common/ccnet-db.c(131): Failed to get database connection: Failed to connect to MySQL: Access denied for user ‘seafile’@‘localhost’ (using password: YES).
[04/22/19 18:07:45] user-mgr.c(1080): Failed to create user db tables.
Traceback (most recent call last):
File “/scripts/start.py”, line 86, in
main()
File “/scripts/start.py”, line 71, in main
call(’{} start’.format(get_script(‘seafile.sh’)))
File “/scripts/utils/init.py”, line 68, in call
return subprocess.check_call(*a, **kw)
File “/usr/lib/python2.7/subprocess.py”, line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘/opt/seafile/seafile-pro-server-6.3.13/seafile.sh start’ returned non-zero exit status 1
*** /scripts/start.py exited with status 1.
*** Shutting down runit daemon (PID 38)…
*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown…
Apr 22 18:07:47 e8fb214b2301 syslog-ng[28]: syslog-ng shutting down; version=‘3.13.2’
*** Killing all processes…

I have backups that I made using the official documentation, and a full copy of the docker volume that I took before starting the migration. What should be my next step to try and recover my data?


#2

I ended up getting this working. The official documentation instructs you to backup and restore everything from /shared/seafile other than the ccnet folder. However there is also a conf folder that contains configuration information. If I restore that folder it breaks the container. If I just restore pro-data, seafile-data, and seahub-data the container works fine.


#3

Since the official container image has several issues, I recommend to use a container setup outof the list in the community manual.
Maybe one of those work better.