mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-11 09:13:02 +03:00
Lost passwords after sqlite->mysql migration #1607
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @francescocarzaniga on GitHub.
Subject of the issue
I have migrated my bitwarden_rs instance from docker to compiled binary and with it also the database from sqlite to mysql, and now usernames/passwords are not visible anymore. The items are present, as well as the collections and organisations, but under each item password and username are no longer there. Weirdly enough secure notes are intact. I can add new items and sync them as well, so the problem is probably not the binary.
Your environment
Steps to reproduce
Migrate from sqlite to mysql using the guide. Ensure the ciphers table is intact and contains all the elements in mysql.
Expected behaviour
Everything works as before.
Actual behaviour
Usernames and passwords are no longer available.
Relevant logs
Sadly the logs are not interesting, even in trace mode.
@francescocarzaniga commented on GitHub:
That was lighting fast! Indeed foreign keys were the problem, everything's working fine now.
Of course, I was only testing the new instance. Databases are not something I like to mess with.
@BlackDex commented on GitHub:
Hello @francescocarzaniga
I have updated the wiki ( https://github.com/dani-garcia/bitwarden_rs/wiki/Using-the-MySQL-Backend ) which will probably fix your issue.
I think the Foreign-Keys were causing some issues, which i now added into the script.
Also, i have tested this my self on a MariaDB v10.5.4 which worked as a charm!
Also, please keep in mind that this not something we can fully support, any loss to data is not something we can be responsible for. Always make backups!