Restoring(migrating) install - nextcloud.sh: line 27: $7: unbound variable

I’m (finally) trying to get around to migrating my 14 to 18 install. MAIB is fully updated on 14 (so is Ubuntu 14 upto date.

I’ve restored with duplicity, then run mailinabox setup again, which ends with this…

Upgrading Nextcloud — backing up existing installation, configuration, and database to directory to /home/user-data/owncloud-backup/2021-01-05-12:49:13…

setup/nextcloud.sh: line 27: $7: unbound variable

Full process: https://pastebin.com/Y214UaVc

I’m not sure what is meant to come after this to know what to expect to be broken - from looking myself I have no IMAP access or (webmail) /mail access. Admin panel works okay. Though for now I’ve had to go back to the old Ubuntu 14 installation for the moment.

Line 27: version_user_external=$7

Hello all, I’m having the same error after updating installing the latest MiaB version v0.51

Looks like there is an incompatibility with the next cloud version set in Line 27:
version_user_external=$7

wget_verify https://github.com/nextcloud/user_external/releases/download/v$version_user_external/user_external-$version_user_external.tar.gz $hash_user_external /tmp/user_external.tgz

Any help? Thank you

Bump (if that is allowed).

I’m not sure what else I can do - other than maybe installing/setting up from scratch and then manually coping mail over with the imapsync etc.

If you don’t get any help here in the forums but feel confident you are following the various guides correctly, try posting an issue in the project GitHub.

Issue open here. https://github.com/mail-in-a-box/mailinabox/issues/1909

It seems migrating to v0.51 might be the problem.

Using “| TAG=v0.45 bash” in the upgrade command, then upgrading to newest after that (currently 0.51) will work.

1 Like

I encountered this myself going from Ubuntu 14 to 18. I edited ~/mailinabox/setup/nextcloud.sh, changing the InstallNextcloud call that migrates from Nextcloud 13 to 14:

# If we are running Nextcloud 13, upgrade to Nextcloud 14
InstallNextcloud 14.0.6 4e43a57340f04c2da306c8eea98e30040399ae5a 3.3.0 e55d0357c6785d3b1f3b5f21780cb6d41d32443a 2.0.3 9d9717b29337613b72c74e9914c69b74b346c466

by adding two blank arguments to the end:

InstallNextcloud 14.0.6 4e43a57340f04c2da306c8eea98e30040399ae5a 3.3.0 e55d0357c6785d3b1f3b5f21780cb6d41d32443a 2.0.3 9d9717b29337613b72c74e9914c69b74b346c466 "" ""

This allowed the migration to continue and the mail server has been working perfectly for a few months now.

1 Like

You saved my day. Thank you! :smile: