mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
Adds a "Database migration" section to Admin Panel / Attachments with two buttons: migrate text-based data (everything except attachments/avatars, which stay on the filesystem) to FerretDB v1 (SQLite), or back to MongoDB. WeKan is connected to one database at a time, so the new server methods open a SECOND driver connection to the OTHER database (both MongoDB and FerretDB v1 speak the MongoDB wire protocol) and copy the text collections from the live database into it, upserting by _id (idempotent, re-runnable). The target URL is WEKAN_FERRETDB_URL (default mongodb://127.0.0.1:27018/wekan) or WEKAN_MONGODB_URL (default mongodb://127.0.0.1:27019/wekan); both must be running. Progress is polled via migrateTextDatabaseStatus and shown live. After it finishes, point MONGO_URL at the other database and restart (on Snap: snap set wekan database=ferretdb / =mongodb). Admin-only. Attachments/avatars are skipped (they live on the filesystem). Thanks to xet7.