If you’re using recent MacPorts, you should have the “migrate” subcommand (see port-migrate(1)) which does exactly what you want.
Otherwise you’ll have to list all your installed/requested ports and do a nuke and pave. If you can’t use the port command to do this then dig around in the “software” directory to find all of the ports you have and their variants, then reinstall the ones you need.