Backuped database brings me a 502

What I did:

  • restored my db.sqlite3 database from my duplicity backup
  • stopped the bitwarden container
  • mv db.sqlite3 db.sqlite3.current
  • copied the restored database into the right folder as db.sqlite3
  • started bitwarden container again
  • logged in, copied the note i deleted a while ago
  • stopped container
  • deleted the database
  • mv db.sqlite3.current db.sqlite3
  • started container again
  • tried to login to the webinterface

→ 502 bad gateway

container log:
[2021-10-19 11:54:12.200][panic][ERROR] thread ‘main’ panicked at ‘Failed to turn on WAL: DatabaseError(__Unknown, “database disk image is malformed”)’: src/db/mod.rs:275

Can anyone help me to get my current live state of the database working again?

First check if you followed the restore procedure at Backing up your vault · dani-garcia/vaultwarden Wiki · GitHub.

If you used Duplicity to back up your database while the container was running, you may have ended up with a corrupt backup since Duplicity is not aware of what SQLite is doing and may snapshot the database files in an inconsistent state. If you did a backup while the container was stopped, then you probably just need to restore the db.sqlite3-wal file along with db.sqlite3.