PPA migration path to Snap?

I’m looking to migrate from the 2.7 PPA to Snap 2.7

This seems to be PPA focused: https://maas.io/docs/backup
I can’t seem to execute the commands within the Snap context. ie…

root@maas-contoller:~# /snap/maas/current/bin/maas-region dbupgrade
Traceback (most recent call last):
  File "/snap/maas/current/bin/maas-region", line 6, in <module>
from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3254, in <module>
def _initialize_master_working_set():
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3237, in _call_aside
f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3266, in _initialize_master_working_set
working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 584, in _build_master
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 901, in require
needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 787, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'maas==2.7.1' distribution was not found and is required by the application

This references a “transitional PPA” but has no documenation: Non-snap MAAS installs

Any pointers?

Any racks can simply be spun down from PPA and redeployed from Snap. The important parts of the Region are in the DB, so if you are running in ‘all’ configuration you should do a db migration (this is good practice anyway for scaling future proofing). This is a non-trivial but not difficult process, and is covered well in the docs related to HA.


The HA docs don’t cover migration of the DB, just HA Postresql. Which isn’t a path I’m going to go down since this is just my home network.

The maas-region command isn’t exposed in the maas Snap, which is necessary for the dbupgrade to compete the migration from the pg_dump

You can use the transitional PPA (apt-add-repository -y ppa:maas/snap-transition) to help with a migration from a deb-based install to the snap.

A simple apt full-upgrade after adding the PPA will migrate maas to the 2.7 snap.

Note that the PostgreSQL database won’t be affected by the migration, the snap will be just pointed at the existing PostgreSQL server.

@ack, sorry for hijacking, but is that transitional PPA recommended only when already on the 2.7 PPA or does it work with earlier versions as well? I’m asking because I have an install that is very old (2.1.x) and I’m looking at the best way to get that up to speed.

My apologies, I see now that the snap has a migrate-deb-to-snap helper script that refers to a minimum version of 2.4 so I’ll give that a try.

Hi @szeestraten, that’s correct. The minimum version where the migration package has been tested is the one from the Bionic release, which is 2.4.

I’m not sure which Ubuntu release is your maas running on, but it needs to be running Bionic to be able to use the transitional PPA.
If you’re running an older release, you should upgrade to Bionic and maas 2.4 first.