Scripted installation of Nextcloud 29 in iocage jail

You should be able to just run the script overtop of it. Make sure you set the NEXTCLOUD_VERSION to the same version as your old install.

1 Like

But that is what failed yesterday.

I did set NEXTCLOUD_VERSION to 27 and edited the script to use php 8.2.

Maybe I need to update the nextcloud config before starting the script and change
'dbhost' => 'localhost:/tmp/mysql.sock', to 'dbhost' => 'localhost:/var/run/mysql/mysql.sock',

Do you want to share the install log? You can PM me if you don’t want sensitive data leaking…

1 Like

I’ve sent it to you.

I notice when it checks your database directory, it is finding files in there, but I don’t see a Nextcloud folder. There should be one present inside the MariaDB folder. Is it?

Yes, there is a /var/db/mysql/nextcloud folder inside the jail and /mnt/storage1/nc-db/nextcloud.

Since the script was looking for nc-db/mariadb I renamed nc-db/mysql to nc-db/mariadb, but nextcloud was there as well.

But yes, the folder nc-db/nextcloud did no longer exist when the script hat finished. Strange…

There are also roundcube and phpadmin folders / databases which were gone as well after running the script.

Could it be that the installation of mariadb did remove them?

It should not be called nc-db/nextcloud

It should be nc-db/mariadb

This is what I have now. And had yesterday before I started:

This isn’t correct. There should be one more directory called “mariadb” in between all that.

So you should have “nc-db/mariadb” and all the files currently in “nc-db” need to go inside “mariadb”

I don’t have nc-db/mariadb.

Remember that my installation is from some years ago. I have mariadb103 10.3.32 installed.

The subdirectories correspond to the databases:

grafik

So you are saying I should mkdir nc-db/mariadb and move everything inside nc-db into nc-db/mariadb?

So inside the jail I would have /var/db/mysql/mariadb/nextcloud?

You don’t have to worry about the jail. It does it’s stuff by itself. But the directory structure has to match what the script is expecting.

I understand

I am struggling with an install of Nextcloud using the script. I have been able to successfully create a jail and install Nextcloud using the script in the past, but for various reasons I had to delete the jail. I still have the data and I want to reinstall Nextcloud.
Every time I run the script it finishes with an error:

  • iocage exec nextcloud chmod 777 /var/run/redis/redis.sock
    chmod: /var/run/redis/redis.sock: No such file or directory
    Command: chmod 777 /var/run/redis/redis.sock failed!
  • [ ‘’ ‘==’ true ]
  • [ mariadb ‘=’ mariadb ]
  • iocage exec nextcloud mysql -u root -e ‘CREATE DATABASE nextcloud;’
    ERROR 2002 (HY000): Can’t connect to local server through socket ‘/var/run/mysql/mysql.sock’ (2)
    Command: mysql -e CREATE DATABASE nextcloud; failed!
  • echo ‘Failed to create MariaDB database, aborting’
    Failed to create MariaDB database, aborting
  • exit 1

Any ideas where I’m going wrong?

Running TrueNAS-13.0-U6.2.

That’s the first place–you’ll need to be running 13.3. That may be the reason that MariaDB is failing.

1 Like

So eventually I tried again. Changed the script to php 8.2 and nc 27. Nextcloud came up this time and I was able to login.

Files are the there but all all the major aps like contact, calender etc. are missing in the menu? On the maintenance screen they are missing as well under my apps. When I search them they appear as active but with version 0.

When I disable an app, the status changes to ‘download and activate’ and when I choose this, the app is available again and even the data seem to be there. Still a bit strange…

It may come as a surprise but in the latest versions of NC, these apps aren’t installed by default anymore.

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).