[Solved] Workaround for upgrading over multiple Versions of MiaB to the latest when multiple major Versions of Nexcloud are included (first accured in upgrade from v0.30/v0.40 (NC13) to v0.42b (NC15) with v0.41 (NC14) between ) ! UPDATED! cose of backup

Hi guys,

Though both of your issues loosely revolve around NextCloud, I really do not think that they are related at all.

@stephank Can you screen cap or copy/paste the output you get before it aborts? It would be a start…

@Wojtek I am a bit lost … so everything works EXCEPT being able to access the admin page status check? But then you mention something about 'Backupsite i get a “[Errno 2] …” I am not following what is happening there, can you elaborate please?
What I would like you to do is to log in via SSH and do the following:
Go to the mailinabox directory and from there you need to
cd management
sudo ./status_check.py
Then copy/paste the output. You can send it to me via PM if you prefer. That may offer a clue.

1 Like

Just do keep it clean and understandable for everybody.

I did send the output of the status check, screenshots of the System Status Check Site and the Backup Site to @alento for investingation via pm cose of server details in the output

hi alento, thank you for your quick reply. here’s the output

    Mail-in-a-Box Version:  v0.42b

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)...
Installing OpenDKIM/OpenDMARC...
Installing SpamAssassin...
Installing Nginx (web server)...
Installing Roundcube (webmail)...
Installing Nextcloud (contacts/calendar)...
Upgrading Nextcloud --- backing up existing installation, configuration, and dat     abase to directory to /home/user-data/owncloud-backup/2019-08-07-20:46:12...
Upgrades from Mail-in-a-Box prior to v0.28 (dated July 30, 2018) with Nextcloud      < 13.0.6 (you have ownCloud 10, 11 or 12) are not supported. Upgrade to Mail-in-     a-Box version v0.30 first. Setup aborting.
stephan@box:~$ Mail-in-a-Box Version:  v0.42b
Installing Postfix (SMTP server)...
Installing Dovecot (IMAP server)...
Installing OpenDKIM/OpenDMARC...
Installing SpamAssassin...
Installing Nginx (web server)...
Installing Roundcube (webmail)...
Installing Nextcloud (contacts/calendar)...
Upgrading Nextcloud --- backing up existing installation, configuration, and dat     abase to directory to /home/user-data/owncloud-backup/2019-08-07-20:46:12...
Upgrades from Mail-in-a-Box prior to v0.28 (dated July 30, 2018) with Nextcloud      < 13.0.6 (you have ownCloud 10, 11 or 12) are not supported. Upgrade to Mail-in-     a-Box version v0.30 first. Setup aborting.
stephan@box:~$

Are you on the Ubuntu 14 server or the Ubuntu 18 server? If the Ubuntu 18 server does the Ubuntu 14 server still exist???

Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-55-generic x86_64)

i am on an 18.04 server. no the old server does not exist anymore (it does but with a new operating system and only the backup stored). the old server was an ubuntu 14.04 machine.
i do not care too much about the data within nextcloud but i do care bout the mails. so if i have to wipe nextcloud, i dont mind.
if it works properly from now on, thats ok for me

Sounds like the answer for u is right there, it looks like u want too upgrade from anything backup lower than from v0.30 directly to v0.42b and that is not supportet

read this: Mail-in-a-Box version v0.40 and moving to Ubuntu 18.04

In quick :
U must first upgrade to v0.30 on the old box , than force a backup, and than go to the new machine with the ubuntu 18 for the installation and than restore of the v0.30 backup before rerun the setup

In your Case:

So with the old machine not existing i only see the option to save the backuped files,… run a old ubuntu, install MiaB (should be a v0.30) , do a restore of the backup u have , force a new backup (than should do a v0.30 backup u can upgrade with) , and save it.

switch to a ubunto18 machine, install MiaB, restore the new forced backup new backup from v0.30 and rerun setup

So if you are on a Ubuntu 18.04 server it should be a brand new fresh install of the OS, which would have never had MiaB installed on it, so I am perplexed why MiaB is trying to upgrade NextCloud.
I think my suggestion would be to have the OS reinstalled with your VPS provider and start again with curl -s https://mailinabox.email/setup.sh | sudo bash.

Your backup is safe in another location, right?

sorry wojtek. but no, i came from an ubuntu 14.04 machine withe the latest miab installed (ie v0.30). then i starteted a new machine and stuck very carefully to the upgrade procedure.

my backup is safe.
i’ll reinstall the system - and will watch if it happens again.
thank you for your help.

Well to keep u up to date with my story,…

@alento was a great help, so we fixed many weak spots in my DNS so the System Status Check site works again.

We deleted one of my secondary DNS-Server that wasnt in service anymore and took the site in a timeout in my multidomain-config, he also teached me about priority in multi MX- Records for more domains - thanks alot for that lesson :+1:

Also the Backup Site is available again - setup just didnt create the /home/user-data/backup/ directory and a sectet_key.txt so i created the directory and moved the original file in there

The issue with the Nextcloud looks a bit harder than expected.

Our way after all of this previous steps was to force a backup (size matched the old one so we are sure no data is lost) and than try to restore it, but after restoreing and while rerunning “sudo mailinabox” i again had the error message:

Blockquote
Installing Nextcloud (contacts/calendar)…
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
Set log level to debug
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed
Maintenance mode is kept active
Reset log level

hey guys, any news on this topic? i am running into nextcloud problems again. i did a clean start on an fresh ubuntu 18.04 VPS from another provider.
did:
curl -s https://mailinabox.email/setup.sh | sudo bash
evertythin ran fine. then i copied the backups (i had from my old ubuntu 14.04 with MIAB v0.30) to the new machine an ran the restoring process
sudo -E duplicity restore --force file:///path/to/copied/files /home/user-data/
this ran fine too.
then, when running
sudo mailinabox
this error message came

Mail-in-a-Box Version: v0.42b

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)...
Installing OpenDKIM/OpenDMARC...
Installing SpamAssassin...
Installing Nginx (web server)...
Installing Roundcube (webmail)...
Installing Nextcloud (contacts/calendar)...
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
Set log level to debug
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed
Maintenance mode is kept active
Reset log level

i am very sure, that i kept my old machine up to date, made updates/upgrades every time the “new version check” reminded me.
so what is wrong?

what i tried was to run
sudo -u www-data php occ upgrade

but i got the same as wojtek
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
Set log level to debug
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed
Maintenance mode is kept active
Reset log level
anybody got a solution? i really wouldn’t want to set up a local VM with Ubuntu 14.04 and restore the backups once again, because i am pretty sure that i made them with version v0.30 of MIAB.

maybe the restoring of the nextcloud backup messes with the actual installation?
anyone got a solution on this?

@alento du u know abot the changes from v0.30 up to v0.40 and finaly v0.42b when it comes to nextcloud?

Cose @stephank mentiont that v0.30 was NC13 and with v0.42b its NC15. is that correct?

Do u know if there was NC14 includet in v0.40 ? Cose in that Version they added “Check of compatibility on all Apps/Plug-/Add-Ins before Upgrade”

And well from NC13 (v0.30) to (if my thoughts are correct) NC14 (v0.40) there wouldnt be a major upgrade in beteween so there was no problem but when u upgrade from v0.30(NC13) to v0.42b(NC15) it would miss the upgrade to NC14 and fails cose it would jump over NC14.

What do u think?

Check this comparision call: https://github.com/mail-in-a-box/mailinabox/compare/v0.30...v0.40

Check this comparision call: https://github.com/mail-in-a-box/mailinabox/compare/v0.40...v0.42b

BTW reading the changelog evolution may help you to know when each Nextcloud version were officialy added.

Thanks a lot!

And yes it is the upgrade from a v0.30 Backup directly to v0.42 !

The upgrade path has to look like v0.30(NC13) -> v0.41(NC14) -> v0.42b(NC15)

Any clue how to install the v0.41 or do a bypass with upgrading NC13 to 14?

I am clueless when it comes to git … but I have seen mentioned something about changing the ‘tag’ to the version you want ??? /shrug

@murgero will know as will @JoshData

I have to shamefully admit it but I have not updated one of my installs yet either, so I am going to face the same problem someday. :frowning:

This is something that definitely should be opened as an issue on github, but the problem is that people have been warned for months to upgrade, so it is unsure if the devs will be willing to help us as officially v0.30 and Ubuntu 14.04 are NOT supported by the project.

You can install older versions by running in your root home dir.

git clone --branch <tag_name> <repo_url>

Then run mailinabox for it to install.

But you should instead just go into the sqlite db file and disable maintenance mode manually. Then update nc through the admin panel.

You would need to use the Git command alternative as follows:

git clone -b v0.41 https://github.com/mail-in-a-box/mailinabox.git

Some general Git info. about, here: https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-clone

so going to the /home/USER/mailin a box an do the git clone over it and run sudo ./mailinabox there?

well how to do that wit the sqlite?

Sounds a bit more easy and less risky than a git clone over a existing v0.42b with existing backups

NO! just run the command as ‘root’ but surely you will need to rename your current /root/mailinabox folder to avoid the ‘folder exists warning’