Nextcloud and Roundcube gone after failed upgrade

Fixed it finally. My issue was a corrupted ibdata1 file (wrong permissions!!), much like in this thread [solved] MySQL service issue - corrupted ibdata1 file

Unfortunately I couldn’t recover from it, so I dumped the dbs that were still intact and recreated mysql like this:

dump dbs, including the mysql db as it contains users
mysqldump mysql > mysqldump.sql
if it works for you, you can use this one:
mysqldump --all-databases > all-dump.sql

stop mysql because we are going to recreate folders
service mysql stop
cp -a /var/lib/mysql/ /var/lib/mysql.orig
rm -rf /var/lib/mysql

initialise new db
mysql_install_db --user=mysql
restart it then restore stuff
service mysql restart
mysql -p mysql < mysqldump.sql

With a new install, the root password will not be set. However YNH initially set one. It can be found under cat /etc/yunohost/mysql

Change mysql root pw like this
mysql -u root
use mysql
SET PASSWORD FOR root@'localhost'= PASSWORD('THE_PW');
flush privileges;

Restart mysql one last time. I was then able to reinstall Nextcloud and Roundcube. Baikal worked using the restored db.