please follow the migration instructions: https://trac.macports.org/wiki/Migration
1. Install the latest version of Xcode.
2. run xcode-select –install in Terminal
3. After updating the development tools, install the base MacPorts system.
MacPorts-2.4.2-10.13-HighSierra.pkg
4. port -qv installed > myports.txt
5. port echo requested | cut -d ‘ ‘ -f 1 > requested.txt
6. sudo rm -rf /opt/local/var/macports/build/*
7.
curl –location –remote-name \
https://github.com/macports/macports-contrib/raw/master/restore_ports/restore_ports.tcl
chmod +x restore_ports.tcl
sudo ./restore_ports.tcl myports.txt
8.
sudo port unsetrequested installed
xargs sudo port setrequested < requested.txt