[GH-ISSUE #1237] Migration from sqlite to mysql incomplete #872

Closed
opened 2026-03-03 02:04:13 +03:00 by kerem · 3 comments
Owner

Originally created by @fbartels on GitHub (Nov 23, 2020).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1237

Subject of the issue

When following the instructions outlined in https://github.com/dani-garcia/bitwarden_rs/wiki/Using-the-MySQL-Backend and https://github.com/dani-garcia/bitwarden_rs/issues/984 to switch from the default sqlite database to a mysql one, users are able to login and see entries. but entries are missing all data such as usernames, passwords, 2fa token, urls (attachments however are preserved).

Your environment

Steps to reproduce

  • sqlite3 db.sqlite3 .dump | grep "^INSERT INTO" | grep -v "__diesel_schema_migrations" > sqlitedump.sql ; echo -ne "SET FOREIGN_KEY_CHECKS=0;\n$(cat sqlitedump.sql)" > mysqldump.sql
  • sed -i s#\"#\#g mysqldump.sql
  • move data to new system
  • import database with mysql --force --password --user=bitwarden_rs --database=bitwarden_rs < mysqldump.sql

Expected behaviour

  • password vault has same data as before the migration

Actual behaviour

  • users can login and see items in vault, but items are missing data such as usernames, passwords, urls

Relevant logs

  • no error to be seen in logs
Originally created by @fbartels on GitHub (Nov 23, 2020). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1237 ### Subject of the issue When following the instructions outlined in https://github.com/dani-garcia/bitwarden_rs/wiki/Using-the-MySQL-Backend and https://github.com/dani-garcia/bitwarden_rs/issues/984 to switch from the default sqlite database to a mysql one, users are able to login and see entries. but entries are missing all data such as usernames, passwords, 2fa token, urls (attachments however are preserved). ### Your environment * Bitwarden_rs version: 1.17.0 * Install method: build from source as part of https://git.cloudron.io/cloudron/bitwardenrs-app/-/blob/master/Dockerfile * Clients used: web vault 2.16.1 * Reverse proxy and version: Apache + Nginx * Version of mysql/postgresql: unknown * Other relevant information: ### Steps to reproduce - `sqlite3 db.sqlite3 .dump | grep "^INSERT INTO" | grep -v "__diesel_schema_migrations" > sqlitedump.sql ; echo -ne "SET FOREIGN_KEY_CHECKS=0;\n$(cat sqlitedump.sql)" > mysqldump.sql` - `sed -i s#\"#\#g mysqldump.sql` - move data to new system - import database with `mysql --force --password --user=bitwarden_rs --database=bitwarden_rs < mysqldump.sql` ### Expected behaviour - password vault has same data as before the migration ### Actual behaviour - users can login and see items in vault, but items are missing data such as usernames, passwords, urls ### Relevant logs - no error to be seen in logs
kerem 2026-03-03 02:04:13 +03:00
Author
Owner

@BlackDex commented on GitHub (Nov 23, 2020):

Did you used the exact same version for sqlite as for mysql?
Not that you used an older sqlite version, and have the mysql run migrations on the database for a newer version.
Because that would cause conflicts.

Those above procedure i have written my self, and i just tested them again, and they seem to work.

<!-- gh-comment-id:732230168 --> @BlackDex commented on GitHub (Nov 23, 2020): Did you used the exact same version for sqlite as for mysql? Not that you used an older sqlite version, and have the mysql run migrations on the database for a newer version. Because that would cause conflicts. Those above procedure i have written my self, and i just tested them again, and they seem to work.
Author
Owner

@fbartels commented on GitHub (Nov 27, 2020):

Thanks for your feedback @BlackDex. The source system was an official build and the target is a self compiled with only mysql support.

Since it works for you I probably made a mistake somewhere, but before reporting i already tried it twice.

But given that I only need to migrate two users I think I will just use Portwarden to get my users on the new system.

<!-- gh-comment-id:735000761 --> @fbartels commented on GitHub (Nov 27, 2020): Thanks for your feedback @BlackDex. The source system was an official build and the target is a self compiled with only mysql support. Since it works for you I probably made a mistake somewhere, but before reporting i already tried it twice. But given that I only need to migrate two users I think I will just use Portwarden to get my users on the new system.
Author
Owner

@BlackDex commented on GitHub (Nov 27, 2020):

It could be some other strange item like, encoding of the database, like unicode utf8.
Do you not get any error message at all during either export or import?

<!-- gh-comment-id:735007366 --> @BlackDex commented on GitHub (Nov 27, 2020): It could be some other strange item like, encoding of the database, like unicode utf8. Do you not get any error message at all during either export or import?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#872
No description provided.