Have you had a look in to this:
Upgrading Sonarr V3 to V4
Did you try to reinstall it with dietpi-software to migrate the db?
Have you had a look in to this:
Upgrading Sonarr V3 to V4
Did you try to reinstall it with dietpi-software to migrate the db?