[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

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’

Ok! the commands sequence should be:

git clone -b v0.41 https://github.com/mail-in-a-box/mailinabox.git
cd mailinabox
git checkout
setup/start.sh

okay running in a problem with NC upgrade again,…

so if i understand it correct i should:

  1. reinstall the machine (so no backupfiles and so on are there anymore)
  2. do the git clone from v0.40 (NC13)
  3. install v0.40
  4. restore my v0.30 Backup from S3 - i will just loose some testmails after jumping from v0.30 to v0.42
  5. do the git clone from v0.41
  6. install v0.41 (upgrade to NC14)
  7. upgrade with normal bash command to v0.42b (to upgrade to NC15)

We will know after you do it and succeed – or fail. Good luck! :slight_smile:

It’s actually easier - don’t do anything else, find where nextcloud is installed, cd into the dir and run:

php occ maintenance:mode --off to disable maintenance mode and get back into NC.

well than we try it,… i was more asking about a logic problem in the steps,… for sure we could fail :slight_smile:

See my comment: Nextcloud problem after .30->.42b

1 Like

So @murgero are you thinking it is easier to just upgrade NC? going to look at that link now?

Keep the data in-tact by doing an in-place upgrade to Nextcloud via nextcloud. It’s the safest way to keep his data.

It can technically still fail, but has a much higher success rate

Thanks a lot to the input and patience of @alento and @just4t and also the analysis of @stephank for the reason why the way of the manual doesent work anymore

We finally have a Workaround for the Upgrade from a Ubuntu 14.04 with maximum v0.30 to the latest version (for now v0.42b) with every neccesary step, that we together planed and testet.

If u have already running MiaB v0.40 jump in at 6)

@stephank i hope u still have the chance to do so :wink:

1) Force a Backup from old MiaB (v0.30) save the encrypted directory and your secret_key.txt

2) Setup Ubuntu 18.04 LTS & update and upgrade to last date and import your secret_key.txt (for example in your home dir) and your saved backup (with S3 Backup u just need the secret_key.txt on your machine)

3) Install v0.40 via github

sudo git clone -b v0.40 https://github.com/mail-in-a-box/mailinabox.git
cd mailinabox
sudo git checkout
sudo setup/start.sh

4) Delete new generated SSL Data before importing the v0.30 backup

cd /home/user-data/
sudo tar cpf old-ssl.tar ssl
sudo rm -r ./ssl/*

5) Import your v0.30 backup

Local backup import

export PASSPHRASE=$(cat /path/to/secret_key.txt)
sudo -E duplicity restore --force file:///path/to/backup /home/user-data/

Amazon S3 backups

export AWS_ACCESS_KEY_ID=paste your AWS access key ID here
export AWS_SECRET_ACCESS_KEY=paste your AWS secret access key here
export PASSPHRASE=$(cat /path/to/secret_key.txt)
sudo -E duplicity restore --force s3://s3.amazonaws.com/your-bucket-name/your-backup-path /home/user-data/

6) run “sudo mailinabox” to upgrade the imported backup to v0.40 standards

6) move the existing mailinabox directory of v0.40

cd /home/USER
sudo mv ./mailinabox ./mailinabox.v40

7) upgrade to v0.41 via github

sudo git clone -b v0.41 https://github.com/mail-in-a-box/mailinabox.git
cd mailinabox
sudo git checkout
sudo setup/start.sh

8) move the existing mailinabox directory of v0.41

cd /home/USER
sudo mv ./mailinabox ./mailinabox.v41

9) repeat steps 7) & 8) for every MiaB-Version were a major Nexcloud update is included

10) upgrade from the version with just one Major Nextcloud release away from the last (in my case v0.41) to the last Version(in my case v0.42b) via curl command

curl -s https://mailinabox.email/setup.sh | sudo -E bash

11) UPDATE! to prevent problems with backups u must be sure your old secret_key.txt is back in /home/user-data/backup

sudo mv /home/user-data/backup/secret_key.txt /home/user-data/backup/secret_key.txt.old
sudo cp /path/to/secret_key.txt /home/user-data/backup/secret_key.txt
(first is the path in the cp command is where u have imported your v0.30 backup data or wher u imported th secret_key.txt file)

Enjoy MiaB in the latest release!


P.S.: @alento or @just4t since i have no expirence with github bugreporting can u report it so we maybe can include a version check for a warning for neccesary upgrades of NC versions (or include the setup of intermediate MiaB versions in the setupscript) ?

2 Likes

thank you very, very much. thats the way to go. just tried it myself, solved my problems. thats the way to migrate from a v0.30 box to an up-to-date one.
great community.

1 Like

Did that yesterday actually. :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.