Nextcloud won't reinstall after uninstall

I had nextcloud fail on update via the portal, it was stuck in maintenance mode, so I changed the config.php to it then said unsupported upgrade path. I thought ok, I have all the data, it’d be easier to uninstall then reinstall than to try to fumble through and fix what’s broken. I did the uninstall, leaving the data, and now when I try to install nextcloud via the portal, it aborts and won’t install.

At this point, I don’t know how to fix without wiping the system and starting over. I am somewhat new to linux, and the fact that a portal installation/upgrade fails so miserably that it broke the main point of this particular system is very frustrating. I just want to fix it without having to reinstall the whole thing.

I have a short window in which I can try to fix this…i.e. a couple of weeks, otherwise, I’ll be starting from absolute scratch.

I figured it out, I had to remove everything manually, especially the database, and manually run the following from root console:

univention-app remove nextcloud
Then removed the docker directory as stated in the output.

Next I had to drop the database:
su -c "psql -c" drop database nextcloud" - postgres && su -c "dropuser nextcloud" - postgres

Then I had to reinstall:
univention-app install nextcloud

Next, I had to run this:
univention-run-join-scripts --ask-pass

Then:

univention-app shell nextcloud
apt-get update && apt-get install nano
nano /var/www/html/config/config.php

Edited to allow direct ip connections from remote locations.

This was unfortunate to have to go through to fix. Hopefully others won’t need to do this in the future.