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 > 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?

  • I think a recent macports discussion list entry suggested using the port command in the old macports using a full path
    – mmmmmm
    Commented Mar 4, 2015 at 11:26
  • @Mark The old port executable was still compiled to use the registry from /opt, so I get the list of currently installed ports. Moving the current ports out of the way and renaming the old dir to /opt, I get an error 'Current platform "darwin 14" does not match expected platform "darwin 13"'.
    – Quantum7
    Commented Mar 5, 2015 at 16:31

1 Answer 1


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .