Migrate from Seafile deployment to Seafile Docker | SQL-data issues

server

#1

Hey!
I’m trying to migrate from Seafile deployment to Seafile Docker and having issues with getting the database data into the volume. I’m getting following connection error:

seafile    | verifying password of user root ...  done
seafile    |
seafile    | verifying password of user seafile ...
seafile    | Failed to connect to mysql server using user "seafile" and password "***": Access denied for user 'seafile'@'localhost' (using password: YES)
seafile    |
seafile    | Traceback (most recent call last):
seafile    |   File "/scripts/start.py", line 86, in <module>
seafile    |     main()
seafile    |   File "/scripts/start.py", line 56, in main
seafile    |     init_seafile_server()
seafile    |   File "/scripts/bootstrap.py", line 126, in init_seafile_server
seafile    |     call('{} auto -n seafile'.format(setup_script), env=env)
seafile    |   File "/scripts/utils/__init__.py", line 68, in call
seafile    |     return subprocess.check_call(*a, **kw)
seafile    |   File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
seafile    |     raise CalledProcessError(retcode, cmd)
seafile    | subprocess.CalledProcessError: Command '/opt/seafile/seafile-server-6.3.4/setup-seafile-mysql.sh auto -n seafile' returned non-zero exit status 255
seafile    | *** /scripts/start.py exited with status 1.
seafile    | *** Shutting down runit daemon (PID 32)...
seafile    | *** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...
seafile    | Mar 10 20:24:11 313fa3993ac8 syslog-ng[25]: syslog-ng shutting down; version='3.13.2'
seafile    | *** Killing all processes...

Before I imported the sql-dump-data via:

docker exec -i seafile mysql -h127.0.0.1 -useafile -p<my_password> seahub_db  < /path_to/seahub-database.sql
docker exec -i seafile mysql -h127.0.0.1 -useafile -p<my_password> seafile_db < /path_to/seafile-database.sql
docker exec -i seafile mysql -h127.0.0.1 -useafile -p<my_password> ccnet_db   < /path_to/ccnet-database.sql

I already added privileges to seafile@localhost to all three databases

select user,host from mysql.user;
+---------+--------------+
| user    | host         |
+---------+--------------+
| seafile | 127.0.0.1    |
| seafile | localhost    |
+---------+--------------+

Do somebody has some hints for me regarding the migration process?

Thanks, Dominik


#2

I’m receiving an identical error message when trying to move from one docker host to another using the documented backup and restore process. I’m very interested to see if anyone has any suggestions.


#3

Hey Dominik,
what password did you use to import the database?
In the Seafile container there is a mysql server running, which gets its own password at startup.

To check the password you can look at the ccnet.conf in the seafile directory. If the Docker container was started with the following parameter
-v /opt/seafile-data:/shared
you can find the ccnet.conf under
/opt/seafile-data/seafile/conf/ccnet.conf

there you will find two lines under [database].
USER = seafile
PASSWD = 4a5sf6fef-4676-4e18-96ce-52w7fb8gdh06


#4

Hi Dennis, I had initialized the /shared folder structure and then used the password mentioned in ccnet.conf as far as I remember. But after a while I gave up and set up an ownCloud server.

I’m sorry to say. But the Docker support is not very advisable.