[GH-ISSUE #598] How to migrate sqlite3 database to Bitwarden_rs/mysql database #399

Closed
opened 2026-03-03 01:28:44 +03:00 by kerem · 3 comments
Owner

Originally created by @BobWs on GitHub (Sep 2, 2019).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/598

Hi,

Thanks for the mysql implementation! At the moment I'm testing this image. I've successfully installed it on Synology docker with mariadb. So far so good.

But how to migrate my current database sqlite3 to mysql database while maintaining all users and all attachments and organizations.

I just tried to export the current bitwarden vault (json file). And I imported it in the new vault (mysql version) and this went well, only the attachments didn't come along. And I also miss the organizations.

Can someone tell you how to do this via a step-by-step plan? Is it possible to do this via phpadmin? For example, that you import the sqlite3 into the bitwarden database?

Originally created by @BobWs on GitHub (Sep 2, 2019). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/598 Hi, Thanks for the mysql implementation! At the moment I'm testing this image. I've successfully installed it on Synology docker with mariadb. So far so good. But how to migrate my current database sqlite3 to mysql database while maintaining all users and all attachments and organizations. I just tried to export the current bitwarden vault (json file). And I imported it in the new vault (mysql version) and this went well, only the attachments didn't come along. And I also miss the organizations. Can someone tell you how to do this via a step-by-step plan? Is it possible to do this via phpadmin? For example, that you import the sqlite3 into the bitwarden database?
kerem closed this issue 2026-03-03 01:28:44 +03:00
Author
Owner

@mprasil commented on GitHub (Sep 4, 2019):

Well between discussion under #497 and in our matrix room, there is no bulletproof way to migrate directly the DB. The only "officially" supported way is export/import via vault, but you have to do this for every user and organization and attachments won't be moved over as you noticed.

Unless someone steps up and writes a tool to migrate the DB and then keeps it up to date with latest schema changes, it's just not easily possible.

<!-- gh-comment-id:527834928 --> @mprasil commented on GitHub (Sep 4, 2019): Well between discussion under #497 and in our matrix room, there is no bulletproof way to migrate directly the DB. The only "officially" supported way is export/import via vault, but you have to do this for every user and organization and attachments won't be moved over as you noticed. Unless someone steps up and writes a tool to migrate the DB and then keeps it up to date with latest schema changes, it's just not easily possible.
Author
Owner

@BobWs commented on GitHub (Sep 4, 2019):

Thanks! I've manage to successfully dump my sqlite3 database en imported this in Mariadb. Everything went smooth all users account, organisations and attachment where imported also the TOTP in some of the account.

If I have time I will put my steps together and post it. It will be based on docker synology because that is the machine I'm using.

<!-- gh-comment-id:527965855 --> @BobWs commented on GitHub (Sep 4, 2019): Thanks! I've manage to successfully dump my sqlite3 database en imported this in Mariadb. Everything went smooth all users account, organisations and attachment where imported also the TOTP in some of the account. If I have time I will put my steps together and post it. It will be based on docker synology because that is the machine I'm using.
Author
Owner

@mprasil commented on GitHub (Sep 4, 2019):

You can add it to our wiki. Also please add some note that this is not officially supported, because I feel like there are lot of edge cases where this will fail. Thanks for reporting back.

<!-- gh-comment-id:528017224 --> @mprasil commented on GitHub (Sep 4, 2019): You can add it to [our wiki](https://github.com/dani-garcia/bitwarden_rs/wiki). Also please add some note that this is not officially supported, because I feel like there are lot of edge cases where this will fail. Thanks for reporting back.
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#399
No description provided.