[3.9] Fix Sqlite db regeneration in case of deleted db