power-mailinabox
power-mailinabox copied to clipboard
Fix damaged nextcloud installation
(daftness alert)
I tried to mount a 2nd disk volume at /home/user-data/owncloud and assumed all would be fine...
Of course I copied to content of the original /home/user-data/owncloud first and then copied it back, but nextcloud says a error has occured.
Running the nextcloud.sh
doesn't help, it complains about many things. Also tried running mailinabox
again, but no joy.
How can I reinstall nextcloud without losing the rest of the configured services and email?
I tried running the script again...
root@productive:~# curl -L https://power-mailinabox.net/setup.sh | sudo bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 3220 100 3220 0 0 5476 0 --:--:-- --:--:-- --:--:-- 10454
Updating Mail-in-a-Box to v60.2 . . .
remote: Enumerating objects: 113, done.
remote: Counting objects: 100% (100/100), done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 39 (delta 34), reused 17 (delta 13), pack-reused 0
Unpacking objects: 100% (39/39), 12.20 KiB | 416.00 KiB/s, done.
From https://github.com/ddavness/power-mailinabox
* [new tag] v60.2 -> v60.2
Primary Hostname: vm1.productive.co.za
Public IP Address: 197.214.119.183
Private IP Address: 192.168.142.101
Mail-in-a-Box Version: v60.2
Updating system packages...
Installing system packages...
Initializing system random number generator...
Firewall is active and enabled on system startup
Installing nsd (DNS server)...
Installing Postfix (SMTP server)...
Installing Dovecot (IMAP server)...
doveconf: Warning: NOTE: You can get a new clean config file with: doveconf -Pn > dovecot-new.conf
doveconf: Warning: Obsolete setting in /etc/dovecot/conf.d/10-ssl.conf:86: ssl_dh_parameters_length is no longer needed
Installing OpenDKIM/OpenDMARC...
Installing SpamAssassin...
Installing Nginx (web server)...
Installing Roundcube (webmail)...
Updating database schema (2021081000)... [OK]
Updating database schema (2021100300)... [OK]
Installing Nextcloud (contacts/calendar)...
PHP Notice: Undefined index: version in Command line code on line 1
Upgrading Nextcloud --- backing up existing installation, configuration, and database to directory to /home/user-data/owncloud-backup/2022-10-20-16:50:37...
Upgrading to Nextcloud version 24.0.6
Nextcloud is not installed - only a limited number of commands are available
Command "upgrade" is not defined.
If I could reinstall nextcloud, the upgrade command may work... How can I do that?
Ok, we got this to work again. Reading the installation script provided clues, so in the end, with the correct ownership of directories and files in /home/user-data/owncloud, it was responding again.
Strangely enough: We got a message saying there's a setting in config.php that is config_is_read_only = true
. It stopped the upgrade from happening. So I changed that in the script (which creates this setting) and it upgraded properly it seems.
Why is that there?
There were a few issues being reported for a while, namely: https://github.com/mail-in-a-box/mailinabox/issues/2120 https://github.com/mail-in-a-box/mailinabox/issues/2004 https://github.com/mail-in-a-box/mailinabox/issues/1885
This is related to a step on nextcloud
configuration that should not be touching that directory, yet they attempt to do it anyway.
The problem with this comes up because when upgrading versions we need to unlock said directory first (which we don't).