MIgration from OwnCloudX with slightly corrupted DB to recent Nextcloud version

Hi guys,

I think the title says the most, but let me explain here what is my concerns.
I have installed an owncloud server quite a long time ago and until now it hasn’t been possible to migrate to Nextcloud. Owncloud version is up to date today.

All along the years, owncloud Databse has started to become more and more corrupted (unable to delete some files, unable to delete some shares, unable ot modify some specific folders,…).
I have now my new FTTH connection and want to take this opportunity to install a new Ubuntu server, using Nextcloud of course.
My point is, I wish I could be able to retrieve users, shares, and all the datas, but I also want to gert rid of my DB corruptions problem.
Can you please guys give me advices on the migration process I should use ?

Best Regards to you all,