Migrating users manually

Nextcloud version : 22.2.8
Operating system and version : Debian 10
Apache or nginx version : Apache 2.4.38
PHP version : 7.3.31

Context :
My Nextcloud appliance is trashed. I can’t go into Apps and can’t upgrade, although day-to-day use is unimpaired. This issue is described in detail in this post :

As far as I know, if I want to upgrade, there is no way out of this but a fresh install (migrating the database to a new install has already been tried and it migrated the issue too).

Thus, I need to re-add everything “manually” on the new install.
I’ll do the server and apps configuration 100% manually, but I’d like to migrate users in a somewhat automated fashion.
I can’t use the migration app though, because I can’t add apps ! (Again, see my previous post - though if you’d like to do deep-debugging with me, we still can try as no one plunged with me last time).

I know that files can be transferred and scanned, but that wouldn’t migrate shares.
Also, that wouldn’t transfer accounts/users !

I’m definitely willing to meddle in Mysql/MariaDB and should have the skills for it.

tl;dr, how would you migrate users with everything they have (shares, most notably) without using the migration app, and without migrating the whole database ?

Finally stumbled upon an old post detailing which databases to use for this :

This wasn’t tested by myself yet, but users there report success.