Converting to SQlite

Hi guys
I’m currently using v5.1.3 on Xubuntu 20.04,
I’m trying to convert my BSDDB to SQlite but it fails every time with the following error

30497: ERROR: line 156: Unhandled exception
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/gramps/gui/”, line 782, in __convert_db_ask
File “/usr/lib/python3/dist-packages/gramps/gui/”, line 125, in init
File “/usr/lib/python3/dist-packages/gramps/gui/”, line 787, in
lambda: self.__convert_db(name, dirname),
File “/usr/lib/python3/dist-packages/gramps/gui/”, line 827, in __convert_db
File “/usr/lib/python3/dist-packages/gramps/gen/db/”, line 597, in load
File “/usr/lib/python3/dist-packages/gramps/plugins/db/dbapi/”, line 196, in _create_schema
File “/usr/lib/python3/dist-packages/gramps/plugins/db/dbapi/”, line 160, in commit
sqlite3.OperationalError: database is locked.

I’ve tried creating a new tree and importing a GEDCOM and .gramps backup file all to no avail, when I try to create a new tree and open it I get a message saying “Low level corruption detected” and suggesting I click the Repair button in the Tree Manager but unfortunately the Repair button is greyed out.
Any help would be appreciated as this is beginning to worry me if the devs decide to no longer support BSDDB

What is the result of gramps -L
By default, in gramps 5.1.3, the database type is sqlite. You don’t need to convert it.