11->12 db migration issues

Am in process of a v11 (binary) to v12 (docker) upgrade, and seahub loads fine in browser, but submitting login information ends in 500 response with following logs (full gist here):

seahub.log:

MySQLdb.OperationalError: (1054, “Unknown column ‘profile_profile.is_manually_set_contact_email’ in ‘field list’”)

seafile.log:

[2026-04-19 20:14:18] [WARNING] ../common/seaf-db.c(928): Failed to prepare sql SELECT r.repo_id, s.size, b.commit_id, v.repo_id, v.origin_repo, v.path, v.base_commit, fc.file_count, i.status, i.type FROM Repo r LEFT JOIN Branch b ON r.repo_id = b.repo_id LEFT JOIN RepoSize s ON r.repo_id = s.repo_id LEFT JOIN VirtualRepo v ON r.repo_id = v.repo_id LEFT JOIN RepoFileCount fc ON r.repo_id = fc.repo_id LEFT JOIN RepoInfo i on r.repo_id = i.repo_id WHERE r.repo_id = ? AND b.name = ‘master’: Unknown column ‘i.type’ in ‘field list’
[2026-04-19 20:14:18] [WARNING] seafile-session.c(616): Failed to get system default repo. Create a new one.
[2026-04-19 20:14:18] [WARNING] ../common/seaf-db.c(928): Failed to prepare sql SELECT r.repo_id, s.size, b.commit_id, v.repo_id, v.origin_repo, v.path, v.base_commit, fc.file_count, i.status, i.type FROM Repo r LEFT JOIN Branch b ON r.repo_id = b.repo_id LEFT JOIN RepoSize s ON r.repo_id = s.repo_id LEFT JOIN VirtualRepo v ON r.repo_id = v.repo_id LEFT JOIN RepoFileCount fc ON r.repo_id = fc.repo_id LEFT JOIN RepoInfo i on r.repo_id = i.repo_id WHERE r.repo_id = ? AND b.name = ‘master’: Unknown column ‘i.type’ in ‘field list’
[2026-04-19 20:14:18] [WARNING] repo-op.c(666): Repo 8d20987e-966d-4451-a359-988fea114495 doesn’t exist.
[2026-04-19 20:14:18] [WARNING] seafile-session.c(579): Failed to add template file /opt/seafile/seafile-data/library-template/seafile-tutorial.doc.

This suggest there’s again some db migration error as per usual. Would roll back and retry, but have no idea where I made the mistake.

To be clear, we’re not required to manually run migration scripts anymore with the docker-based deployments, are we?

Why do these broken states occur so often with seafile upgrades? Why does it even allow service to start when migration clearly has failed at some point?

The “Unknown column” errors in your logs confirm that the database schema is still at version 11, which causes Seahub to fail when it looks for version 12 fields like is_manually_set_contact_email and i.type.

While Seafile Docker normally automates migrations for standard Docker-to-Docker upgrades, this automation may not trigger correctly when migrating from a binary deployment to a Docker deployment. In this specific migration path, you must manually bridge the database gap.

Solution: Manual Database Upgrade

Follow these steps to manually run the migration script inside your new Docker container:

  1. Access the Seafile container:

    docker exec -it seafile bash
    
  2. Stop the Seafile and Seahub services inside the container:

    cd /opt/seafile/seafile-server-latest
    ./seafile.sh stop
    ./seahub.sh stop
    
  3. Run the version 11.0 to 12.0 upgrade script:

    cd upgrade
    ./upgrade_11.0_12.0.sh
    

    Once the script finishes, you should see a message confirming the updates to the seafile, seahub, and seafevents databases.

  4. Exit and restart the stack:

    exit
    docker compose restart
    

Important Notes for Version 12.0:

  • ALLOWED_HOSTS: If you encounter a “400 Bad Request” after logging in, ensure 127.0.0.1 is included in the ALLOWED_HOSTS list in your seahub_settings.py .
  • Environment File: Ensure your .env file is properly configured with your MySQL credentials and a JWT_PRIVATE_KEY (minimum 32 characters) .
  • SeaDoc: If you were using SeaDoc 0.8, the sdoc_db is no longer required as of version 12.0; its data is now integrated into the seahub_db .