Scripted installation of Nextcloud 29 in iocage jail

Hi, I built my instance of nextcloud using your script a good few years ago.

Nextcloud is saying that I will be forced to update to PHP 8.2/8.3 very soon.
You are currently running PHP 8.1.17. PHP 8.1 is now deprecated in Nextcloud 30. Nextcloud 31 may require at least PHP 8.2. Please upgrade to one of the officially supported PHP versions provided by the PHP Group as soon as possible. For more details see the documentation.

However, I have tried and failed. I have posted for help and failed, I even allowed a member on this forum to have a tinker via remote access. All failed.

It seems I cannot update to PHP 8.2 or 8.3.

So I was advised I might take backups of the Nextcloud jail and the /nextcloud dataset (backup, rename or just snapshot them) and then use the script to create a new Nextcloud instance. I have questions.

What i want to do is install via the script with the old instance in place (with original dataset/folder/file names). Will it be a non-destructive update of Nextcloud but keep all my setting, users, the user files, the DNS cert from Let’s Encrypt etc?

I only went through the install process once before a long time ago. I bet I will have problems.

So I wanted to ask your advice on the procedure so i can have something to follow and gain a little confidence in what i am doing before just diving in.

Also, will a reinstall using your script actually install with a newer version of PHP?

(or maybe you might even know how I can update PHP without needing to reinstall the entire nextcloud instance since no one else does).