Restoring Bitwarden creation/revision timestamps after migrating to Vaultwarden #7264
Druxtt
started this conversation in
Show and tell
Replies: 1 comment 3 replies
|
Export and import are done by the client, not by the server, so it may not be possible for Vaultwarden to change this behavior. |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When I migrated from a Bitwarden Premium account to my self-hosted Vaultwarden instance, I used the standard export/import workflow — which worked perfectly for all credentials. However, I noticed something frustrating: all my
CreatedandRevisedtimestamps had been reset to the import date. 566 entries, all showing the same timestamp.This is a known issue reported by several users. Even though Vaultwarden is Bitwarden-compatible and both export formats share the exact same JSON fields (
creationDateandrevisionDate), the import process simply ignores them.Since those timestamps were meaningful to me (knowing when a credential was first created or last changed), I decided to restore them by patching the SQLite database directly.
The approach
Both the Bitwarden and Vaultwarden JSON exports contain
creationDateandrevisionDate. The problem is that entry IDs and folder IDs differ between the two vaults — so a direct mapping isn't possible. Instead, I wrote a Python script that:(folder_name, name, username)as a composite keyUPDATEstatementsThe script also creates an automatic backup of the database before doing anything.
One gotcha: the timestamp format
This took a few attempts to get right. The format Vaultwarden actually stores in SQLite is:
That's 9-digit nanoseconds, no UTC suffix. Both
603000 UTC(microseconds + suffix) and603 UTC(milliseconds + suffix) caused Vaultwarden to panic on startup with a deserialization error. Worth knowing if you ever write to thecipherstable directly.Results
Out of 571 Vaultwarden entries:
Pretty clean outcome.
I can share the python script if anyone would need it
Hope this helps someone. And if Vaultwarden ever adds native timestamp preservation on import, this whole workaround becomes unnecessary — would be a nice quality-of-life addition!
All reactions