Error when saving to OneDrive

Update 2021-04-08: the issue has been resolved by the recent OneDrive update.

In a recent update, Microsoft set OneDrive’s integration with the system to read-only mode:

Issue description on OneDrive support portal
Issue description on OneDrive support portal

As a result, KeePassium cannot save changes to databases stored in OneDrive:

Error screenshot: You don't have permission to save the file '...' in the folder '...'
Error shown when saving a OneDrive database

Workaround

Until Microsoft fixes their app, there are two options:

  1. Sync using third-party app
    • Install BoxCryptor (free) or similar app. It will work directly with OneDrive servers and thus avoid any limitations of the original OneDrive app.
    • In BoxCryptor, add OneDrive source and enter your credentials
    • Open iOS Files app and make BoxCryptor visible there
    • Open KeePassium, tap Plus → Open Database → Boxcryptor → select your database.
      • Free version of KeePassium supports only one database at a time, so you might need to remove (not delete!) the previous database from KeePassium first.
  2. Sync manually
    • Download the database and edit it as a local file:
      • Open OneDrive
      • Tap next to your database → Open in another app → KeePassium
      • The database will be copied to KeePassium as a local file
    • To upload local changes back to OneDrive:
      • Open KeePassium and go to the list of databases (tap < Back a few times)
      • Long-press the database → Export → OneDrive