I managed to upgrade an old version (3.10) to version 4.
1) I did a clean install (another server and db) of the latest version 3.20 and I got a clean database (cleaned all tables, manual step) from the latest version of v3.
2) I made a backup of my official database, except for some tables see command below. The chv_pages and chv_storage_apis after, I configured when I was already in version 4. mysqldump -u root -p --no-create-info --complete-insert --ignore-table=chv_db.chv_pages --ignore-table=chv_db.chv_storage_apis chv_db> backup.sql
3) Tables cannot have a custom prefix in tables, it must be the default chv_ (if you don't do this, it will cause problems when updating from v3 to v4) (don't ask me why)
4) I restored my old bank (data only) in this clean bank. (this step is not that simple)
5) The settings table, from the latest v3 will have more configuration lines (in table chv_settings). You must detect which lines are new compared to your current version (mine was v3.10), I did this using excel and inserted in the update.
6) Here the database is already in the latest version v3, now just install v4.0.0
7) Restore the folder where the user avatars and cover.
8) Version 4.0.0 running normally, you can update to version 4.0.8
It's not simple, it's all very manual and needs accurate knowledge.