recklessop / unifi-va

Unifi Virtual Appliance Scripts
GNU General Public License v3.0
31 stars 14 forks source link

Can't upgrade to Unifi-7.5 #9

Closed Ysbrand closed 1 year ago

Ysbrand commented 1 year ago

Trying to upgrade and it ends up in having some conflicts

Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.

Full log: `================================================== = Recklessop's Unifi Virtual Appliance = = Info and Config menu v1.2.0 =

================================================== Select an action from the menu below

1.) Update Unifi Application 2.) Configure Network Settings 3.) Update Unifi-va Scripts 4.) Bash Shell 5.) Change unifi user password 6.) Update system UUIDs 7.) Exit 3 Updating Unifi from GitHub HEAD is now at abf5fca Merge pull request #3 from recklessop/recklessop-uuid-patch warning: redirecting to https://github.com/recklessop/unifi-va.git/ From http://www.github.com/recklessop/unifi-va

The following packages have unmet dependencies: mongodb-org-server : Conflicts: mongodb-clients but 1:3.6.3-0ubuntu1.4 is to be installed Conflicts: mongodb-server but 1:3.6.3-0ubuntu1.4 is to be installed mongodb-org-shell : Conflicts: mongodb-clients but 1:3.6.3-0ubuntu1.4 is to be installed Conflicts: mongodb-server but 1:3.6.3-0ubuntu1.4 is to be installed mongodb-org-tools : Conflicts: mongodb-clients but 1:3.6.3-0ubuntu1.4 is to be installed Conflicts: mongodb-server but 1:3.6.3-0ubuntu1.4 is to be installed E: Broken packages Press any key to Continue... `

kakra commented 1 year ago

You can upgrade if you manually add the new 3.6 mongodb sources and import the gpg key. After this, remove the old sources. The mongodb update works in-place during starting the unifi services, so I stopped them before running the update. You might want to make a backup or snapshot first.

We've done it here for a controller running over 30 sites with more than 3000 devices, and it worked.

Ysbrand commented 1 year ago

Hi Kakra, thanks for your quick answer.

Can you provide some hints on how to do this? I'm ok with Linux command prompt, but not really familiar with this Linux flavor.

kakra commented 1 year ago

Yes, login via SSH or gain shell access. Select menu 4 (bash shell), then run sudo -i to switch to the root user (and maybe menu 4 again).

Now run:

# create new sources (maybe xenial needs to be changed for you, it works here)
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" \
    | tee /etc/apt/sources.list.d/mongodb-org-3.6.list

# import the new security key
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5

# update the sources (it should show no serious error, warnings maybe)
apt update

# last chance to create a backup!

# stop unifi services for mongodb replacement
systemctl stop unifi

# upgrade the system
apt upgrade

# this takes a while, unifi service should come up by itself
# the service may take a while until its ready due to mongodb conversion

# remove old mongodb 3.4 sources
rm /etc/apt/sources.list.d/mongodb-org-3.4.list
Ysbrand commented 1 year ago

Brilliant, works like a charm.

Some notes: menu item 4 brings me right away to root, no need for sudo -i (which actually brings you back in the menu).

apt update generates some errors: N: Skipping acquire of configured file 'ubiquiti/binary-i386/Packages' as repository 'http://www.ui.com/downloads/unifi/debian stable InRelease' doesn't support architecture 'i386' W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release: The following signatures were invalid: EXPKEYSIG BC711F9BA15703C6 MongoDB 3.4 Release Signing Key <packaging@mongodb.com> W: Failed to fetch http://repo.mongodb.org/apt/ubuntu/dists/xenial/mongodb-org/3.4/Release.gpg The following signatures were invalid: EXPKEYSIG BC711F9BA15703C6 MongoDB 3.4 Release Signing Key <packaging@mongodb.com> W: Some index files failed to download. They have been ignored, or old ones used instead. But it doesn't seem to have an impact as the rest up the process works without any issue.

Thanks again!