Resource icon

Scripted installation of Nextcloud 28 in iocage jail 2018-03-23

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I don't see that job created by default when the jail is created.
Here's the output in a freshly-created jail:
Code:
root@nextcloud:~ # crontab -u www -l
*/5 * * * * /usr/local/bin/php -f /usr/local/www/nextcloud/cron.php

The script is supposed to create this crontab, and at least for me, it does.

Changing the script to install pgsql15 (and remove the -q flag) and re-running it; let's see what this does.
I wasn't able to get it working with pgsql15; the issue seems to be (at least in part) that the PHP extension depends on the pgsql13 client. Updating the script to install pgsql13 (and to start it using the data13 directory) results in a working installation. I'll have the updated script in the repo hopefully this afternoon.
 

GJSchaller

Contributor
Joined
Feb 10, 2021
Messages
100
Here's the output in a freshly-created jail:
Code:
root@nextcloud:~ # crontab -u www -l
*/5 * * * * /usr/local/bin/php -f /usr/local/www/nextcloud/cron.php

The script is supposed to create this crontab, and at least for me, it does.

I just re-created my jail while troubleshooting another issue - crontab -u www -l comes back with "no crontab for www" on my end.

I'm 90% sure I'm using the most recent script from GitHub, unless the dates are wrong on my end for some reason.
 

GJSchaller

Contributor
Joined
Feb 10, 2021
Messages
100
Confirming that even after I downloaded a clean copy of the script from GitHub, the cron job is not being created.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Confirming that even after I downloaded a clean copy of the script from GitHub, the cron job is not being created.
It is also automatically created for me. When you ran the script command, it should have produced a file called nextcloud.log
Maybe it would have some clues as to why it wasn't created.
 

GJSchaller

Contributor
Joined
Feb 10, 2021
Messages
100
It is also automatically created for me. When you ran the script command, it should have produced a file called nextcloud.log
Maybe it would have some clues as to why it wasn't created.

I don't see the .log file, where would it be located?

I did see the script run the command to set the cron job, and it paused for a very long time at that step, but still didn't set it. This was for a new setup completely from scratch, not upgrading / reinstalling from an existing jail & dataset.
 
Joined
Aug 12, 2021
Messages
6
You could try disabling the polls app to begin with using this command.
su -m www -c 'php /usr/local/www/nextcloud/occ app:disable polls'
Then try the update again, and reenable polls after.
Or try removing it by replacing 'disable' with 'remove' in the above command.
Or perhaps doing an 'update polls' first.
Thank you!
That did it. I had no experience controlling nextcloud through commandline.
 

ThatGuyAZ

Dabbler
Joined
Apr 28, 2021
Messages
32
Team I installed this script at Nextcloud 21, and thus am being told my installation is EOL.
How do I use this script to update Nextcloud without losing any data or settings? As it was a couple years ago now when I did the install, I don't even remember all that I had to do to get it up and running and would like to not have to recreate it if I don't have to.

Thanks in advance.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
You can just clone the script again, a run it again, but...

There are a few steps you will have to complete, before running it, because some things have been updated recently concering MariaDB.

1. To start off, you can just clone the repo again to get the updated version of the script.

2. Delete the file /mnt/poolname/pathto/nextcloud/db/mariadb/my.cnf BEFORE reinstalling or else the mysql-server won’t start during the reinstall. (notice that the path is the path of you pool where you mounted the files on the first install)

3. This next step should be done after reinstalling. Replace the line 'localhost:/tmp/mysql.sock' with 'localhost:/var/run/mysql/mysql.sock' in the config file located at /mnt/poolname/pathto/nextcloud/config/config.php This is necessary or you will get a 500 Internal Error.
 

ThatGuyAZ

Dabbler
Joined
Apr 28, 2021
Messages
32
You can just clone the script again, a run it again, but...

There are a few steps you will have to complete, before running it, because some things have been updated recently concering MariaDB.

1. To start off, you can just clone the repo again to get the updated version of the script.

2. Delete the file /mnt/poolname/pathto/nextcloud/db/mariadb/my.cnf BEFORE reinstalling or else the mysql-server won’t start during the reinstall. (notice that the path is the path of you pool where you mounted the files on the first install)

3. This next step should be done after reinstalling. Replace the line 'localhost:/tmp/mysql.sock' with 'localhost:/var/run/mysql/mysql.sock' in the config file located at /mnt/poolname/pathto/nextcloud/config/config.php This is necessary or you will get a 500 Internal Error.
Thanks will try this out this afternoon.
Appreciate it.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
@victort Can you do a database migration (occ upgrade) across multiple versions, i.e. from 21 to 27?
 

victort

Guru
Joined
Dec 31, 2021
Messages
973

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I have never actually tried that. I’ve always just rerun the script and things just worked.
How so? If you have existing data, a database schema upgrade is mandatory ... or did you run it frequently enough so you did not skip a version?
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
How so? If you have existing data, a database schema upgrade is mandatory ... or did you run it frequently enough so you did not skip a version?
Correct.

I do recall something about it not working across major versions though.
The most I have done IIRC is 25 to 27. No issues though.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
He needs to get the intermediate connected PHP and MariaDB updates, too, somehow. I doubt you can upgrade to 27 on the PHP version supported by 21 ...

Folks, please, if you have an Internet facing Nextcloud installation, applying all updates Nextcloud publishes, is mandatory. That is approximately once every 1-2 months, if I remember correctly. We patch all our systems (roughly 1000 jails) once per month.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
What you could do is re-run the script with NEXTCLOUD_VERSION=21. That way you’ll get the PHP updates as well as the MariaDB updates. Once that’s done you can just update from 21 to 22, 22 to 23, 23 to 24, etc…

I just don’t know if 21 supports the new PHP versions.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776

ThatGuyAZ

Dabbler
Joined
Apr 28, 2021
Messages
32
I did go in and try to just rerun the script, unfortunately it failed as it stated that the Jail was already created.......
So I came back to this thread and seen that you all suggest using the updater...... I didn't even realize there was a updater built into Nextcloud until your above conversation. It took me a while to find it, as I never log in using the admin account, but I have now gone in and used the updater to get to version : Nextcloud Hub 3 (25.0.12)

Now it won't let me upgrade anymore and says that I am up-to-date, although it appears that 27.0.12 is latest version. What do I need to do now to get it upgraded to that version? Secondly it is showing a couple things that it thinks that i need to fix on my installation to make it run better.

One is securing via HSTS by making changes to a file, but that appears to be for apache installations? Can someone direct me to where I would go to find out how to secure this for Caddy that we run after using this script?
It also states that my instance is missing a PHP module (intl) that will help performance? Should I add that also? Is doing something like pkg add intl where I would start or will that muck up things because the script was used?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I did go in and try to just rerun the script, unfortunately it failed as it stated that the Jail was already created....
You would need to use a new jail name, then move your data, I guess.

Please post the output of pkg info | grep nextcloud inside your jail.
 
Top