Import backup from seafile 6.1.1 into new docker container resulted in a broken database

Hi,

I have a backup from a natively installed seafile 6.1.1 system.
The previous VM with this natively installed seafile is broken now and I want to switch to the docker variant of seafile.

When I start a docker container for seafile 6.1.1 I get a container that seems broken (the running mysql doesn’t contain seafiles databases, running seaf_fsck.sh complains that it cannot access mysql and the container untypically starts a bash shell and needs to run interactively.

Therefore I tried the next available images and I think 6.2.5 was the first the correctly started. I then restored the databases for ccnet_db, seafile_db and seahub_db from my backup and also the actual seafile-data and seahub-data data directories.
I started the same image in a new container again and as I got no error messages, I assumed everything went well.

I then stopped this container and started a new one from image 6.3.4. Again I did not get an error message and even noticed that the upgrade script was run for it.

But after the container was started I noticed that I could not log in via web interface.

When looking into the log files I see:

==> logs/seafile/ccnet.log <==
[06/24/20 14:53:01] ../common/session.c(398): Accepted a local client
[06/24/20 14:53:01] ../common/ccnet-db.c(425): Error prepare statement SELECT email FROM EmailUser WHERE reference_id=?: mysql_stmt_prepare failed: Unknown column 'reference_id' in 'where clause'.
[06/24/20 14:53:01] ../common/ccnet-db.c(425): Error prepare statement SELECT e.id, e.email, is_staff, is_active, ctime, passwd, reference_id, role  FROM EmailUser e LEFT JOIN UserRole ON e.email = UserRole.email  WHERE e.email=?: mysql_stmt_prepare failed: Unknown column 'reference_id' in 'field list'.
[06/24/20 14:53:01] ../common/ccnet-db.c(425): Error prepare statement SELECT e.id, e.email, is_staff, is_active, ctime, passwd, reference_id, role  FROM EmailUser e LEFT JOIN UserRole ON e.email = UserRole.email  WHERE e.email=?: mysql_stmt_prepare failed: Unknown column 'reference_id' in 'field list'.

So apparently the upgrade did not so well as I expected.

Now, what is the actual problem? Is it correct that some upgrade script did not run or at least didn’t do what it should? How can I get it back into a working state?

Many thanks in advance for any help!

Because the database tables for different versions are different. I suggest you first upgrade your non-container version to version 7.0 and run the upgrade script, then migrate to version 7.0 docker.

I was hoping I could upgrade directly from 6.1.1 into docker as I didn’t have the initial installation working anymore.

I now set it up on a fresh installation, upgraded and then switched to docker. It seems to be working fine now.

Many thanks!