I am trying to update a Seafile 8/Debian 11 install to a Seafile 12/Debian 13 install, as Seafile 8 does not seem to start on Debian 13. After following the installation steps, instead of running the normal setup script, I am trying to run the update scripts to update my database structure to Seafile 12 before setting it up. However, the 9.0-to-10.0 script fails with this message:
Failed to connect to mysql database ccnet_db: Access denied for user ‘seafile’@‘localhost’ to database ‘ccnet_db’
The point is that there is no “ccnet_db” database in my old install: my MariaDB databases had custom names, which were duly entered at setup and are supplied in conf/ccnet.conf. Is this a bug in the script? What can I do? Even if I wanted to update to a Docker image rather than keeping up with a local install, I would still need the upgrade scripts to work.
As far as I know, that script should be getting the database names from your config files. I used to use custom database names, and I don’t remember having a problem with that version, but it was long enough ago that I might have just forgotten.
Anyway, I had a quick look at the upgrade script, and while I’m not good with python, it does look like you can give the database names in the environment like this:
export SEAFILE_MYSQL_DB_CCNET_DB_NAME=ccnet_db
export SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=seafile_db
export SEAFILE_MYSQL_DB_SEAHUB_DB_NAME=seahub_db
./upgrade_9.0_10.0.sh
Honestly, when I read your suggestion, I thought “it can’t be this easy”… but it was. Thanks 1000! So I could perform the DB upgrades, then launch the setup script (which - even after selecting “use existing database” - failed at the last db setup, but I just ignored the issue) and after fixing more and more unexpected problems (including having to install Python module gevent, which was missing from the instructions, and upgrade sqlalchemy to the latest version, and manually add CSRF_TRUSTED_ORIGINS to seahub_settings.py as the web interface would otherwise reject my login attempts) now my new Seafile 12 / Debian 13 installation seems to work, having beautifully preserved all my libraries. Thanks a lot!
Excellent! I’m glad it helped.
1 Like