In short: reinsall everything which has been compiled in or linked against libraries the old system.
- Upgrade OS
- Install or Upgrade XCode
- Start XCode to perform some final steps
- Clean CLI Tools:
rm -rf /Library/Develper/CommandLineTools
- Reinstall CLI Tools:
xcode-select --install
The process is described in detail here: https://trac.macports.org/wiki/Migration. This will probably take very long and you will likely reinstall many oudated and unused packackes.
An alternative ist to clean erverything and reinstall only required packes.
port installed active > ports.txt
; alternativelyport installed requested and active > ports.txt
gives a more concise list but requested and "in use" are not the same in my experience- Uninstall all of MacPorts https://guide.macports.org/chunked/installing.macports.uninstalling.html
- Install MacPorts for the new Mac OS version.
- Reinstall desired ports maually by picking the contents of
ports.txt
Some packages like Postgresql e.g. require further manual setup steps.