Migrating macports from a backup location I recently had a Mavericks system die. The replacement is on Yosemite, so MacPorts can't be directly copied. Instead, I installed the macports base and now I'm trying to restore all the packages.

The migration instructions start with getting a list of installed ports on the old system:

port -qv installed &gt; myports.txt


However, there doesn't seem to be any way to specify the location of the backup MacPorts registry file (which was placed in "/opt (from old Mac)" by the Migration Assistent). I've tried renaming the directories, but port fails with an error about mismatched platforms.

Is there any way to see the full list of packages from the backup version, or do I need to guess this based on the old bin directory?
It seems that the location can only be set when compiling macports from source (using the --prefix option).

Rather than going down that route, I copied my old macports directory from the backup location to /opt, I then re-ran the current macports installer, which overwrites the "darwin 13" binaries and updates the database file. Following this I was able to follow the steps in the migration instructions to reinstall all ports.