Forgotten password of only owner

There is only one owner in self-hosted installation. It owns main organisation which is used by others for password sharing.

We have access to /admin. It’s ok for current owner to be deleted and recreated if needed.
What is the safe way to promote some other user to owner, without losing organisations’ passwords?

Anyone?

At least, is it safe to delete and recreate owner?

Hello @bgw,

The best way would be to modify the database, i would first create a backup of course.

For the exact details i have to check on a test database. But atm i i can’t check that.

1 Like

From the bitwarden_rs data directory (the one that contains the db.sqlite3 file), run the command below. Replace user@example.com with the email of the user who should be the new owner, and OrgName with the name of the org being modified. The new owner must be an existing confirmed member of the org. This query also assumes the org name is unique within this bitwarden_rs instance; if that’s not true, you can add AND billing_email = billing_user@example.com to the org UUID subquery.

sqlite3 db.sqlite3 "UPDATE users_organizations SET atype = 0 WHERE user_uuid = (SELECT uuid FROM users WHERE email = 'user@example.com') AND org_uuid = (SELECT uuid FROM organizations WHERE name = 'OrgName');"

Once the new owner logs in again, they should have full access.

As a follow-up on this.
You can now do this via the /admin interface by clicking on the organization name shown in the row of the user you want to modify.