Deleting from the database can cause data loss, it is necessary to identify what generates this and correct it from the admin interface here are some tips :
If you store your files in MySQL Base you gave change this value to Files System or Redis
And
When you change one of these values you have to let the cron do its work smoothly and not interrupt. It is better to close the forum during the procedure.