Upgrade nextcloud docker to 18.03; deleted old images


today i pulled the latest docker nextcloud and smart as i am i deleted my old docker images of nextcloud. After deploying nextcloud with docker-compose i get the following error message from the website:
Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

If i run the occ i get this in the first line:
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Nextcloud 18.0.3

so i tried the upgrade option and get this:
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed

Now my problem is i have no clue what older version i used. I tried to download version 15, 16 and 17 but the problem with those is they won’t even start.

Can i look up my old version of nextcloud somewhere?
Am I approaching this right with finding my older version docker container and trying to upgrade?

the only thing i found is the version.php but in there is the version of the latest image.

Thanks in advance.

okay i could fix it. i guessed my version to be something like 15.
than i deleted the version.php file and loaded a 16.0.9 image. (The deletion of the file was crusial otherwise the 16.0.9 image would not start in maintenance.
With that i could get nextcloud up and running in maintenance mode(it started automatically in maintenance mode).

After that i ran docker-compose exec --user www-data app php occ upgrade.
This updated my nextcloud to 16.0.9 and the website was reachable and all worked.

After that i did all the other upgrades.