Lost passwords after sqlite->mysql migration #1607

Closed
opened 2025-10-09 17:22:20 +03:00 by OVERLORD · 2 comments
Owner

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

  • Bitwarden_rs version: 1.16.3
  • Install method: previously docker, now compiled from source
  • Clients used: all
  • Reverse proxy and version: nginx
  • Version of mysql/postgresql: previously sqlite3, now mysql 5.7
  • Other relevant information:

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.

Originally created by @francescocarzaniga on GitHub. <!-- Please fill out the following template to make solving your problem easier and faster for us. This is only a guideline. If you think that parts are unneccessary for your issue, feel free to remove them. Remember to hide/obfuscate personal and confidential information, such as names, global IP/DNS adresses and especially passwords, if neccessary. --> ### 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 <!-- The version number, obtained from the logs or the admin page --> * Bitwarden_rs version: 1.16.3 <!-- How the server was installed: Docker image / package / built from source --> * Install method: previously docker, now compiled from source * Clients used: all * Reverse proxy and version: nginx * Version of mysql/postgresql: previously sqlite3, now mysql 5.7 * Other relevant information: ### Steps to reproduce <!-- Tell us how to reproduce this issue. What parameters did you set (differently from the defaults) and how did you start bitwarden_rs? --> Migrate from sqlite to mysql using the guide. Ensure the ciphers table is intact and contains all the elements in mysql. ### Expected behaviour <!-- Tell us what should happen --> Everything works as before. ### Actual behaviour <!-- Tell us what happens instead --> Usernames and passwords are no longer available. ### Relevant logs <!-- Share some logfiles, screenshots or output of relevant programs with us. --> Sadly the logs are not interesting, even in trace mode.
Author
Owner

@francescocarzaniga commented on GitHub:

That was lighting fast! Indeed foreign keys were the problem, everything's working fine now.

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!

Of course, I was only testing the new instance. Databases are not something I like to mess with.

@francescocarzaniga commented on GitHub: That was lighting fast! Indeed foreign keys were the problem, everything's working fine now. > 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! Of course, I was only testing the new instance. Databases are not something I like to mess with.
Author
Owner

@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!

@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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#1607