<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi,</p>
    <p>  The following is the Migration procedure as listed in Macport
      website.</p>
    <p>  1)  For 1. below , should I use Xcode15 or older version?</p>
    <p>  2) Does the following procedure work? Is there anyone who has
      successfully migrated Macport to Sonoma?</p>
    <p> 3) How long will this migration procedure take?</p>
    <p> 4) I have upgraded to Sonoma OS. But why my present ports still
      work? <br>
    </p>
    <p>  Thanks</p>
    <p>  Tao</p>
    <p><br>
    </p>
    <p>===============<br>
    </p>
    Migration procedure
    <ol>
      <li><span class="wikianchor" id="xcode"><strong>Install the latest
            version of Xcode and the Xcode command-line tools</strong><a
            class="anchor"
            href="https://trac.macports.org/wiki/Migration#xcode"
            title="Link to #xcode"></a></span>
      </li>
    </ol>
    <blockquote>
      <p>
        <a class="ext-link"
          href="https://guide.macports.org/#installing.xcode"><span
            class="icon">​</span>Install the latest version of Xcode</a>
        that is compatible with your OS.
        Open the Xcode application once after installation and follow
        any prompts.
      </p>
    </blockquote>
    <blockquote>
      <p>
        Install the same version of the command line tools. (Run <code>xcode-select
          --install</code>). Recent versions of macOS have a bug that
        prevents them from automatically updating the command line
        tools, so if the preceding command says they're already
        installed, they may not be up to date and you may need to update
        manually by following the instructions in <a class="wiki"
          href="https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt">ProblemHotlist#reinstall-clt</a>.
      </p>
    </blockquote>
    <ol start="2">
      <li><span class="wikianchor" id="base"><strong>Reinstall MacPorts
            base system</strong><a class="anchor"
            href="https://trac.macports.org/wiki/Migration#base"
            title="Link to #base"></a></span>
      </li>
    </ol>
    <blockquote>
      <p>
        To reinstall, simply <a
          href="https://www.macports.org/install.php">install the base
          MacPorts system</a>
        for your new platform. If there is no macOS Installer package
        available for your new OS version, you can install from source.
      </p>
    </blockquote>
    <ol start="3">
      <li><span class="wikianchor" id="config"><strong>Update your
            macports.conf (if not default)</strong><a class="anchor"
            href="https://trac.macports.org/wiki/Migration#config"
            title="Link to #config"></a></span>
      </li>
    </ol>
    <blockquote>
      <p>
        If your <code>macports.conf</code> (typically at <code>
          /opt/local/etc/macports/macports.conf</code>) contains
        uncommented settings for <code>universal_archs</code> or <code>build_arch</code>,
        you will likely want to update them, since newer OS versions may
        support different CPU architectures. Default values are fine for
        most users, so unless you know you need something different,
        just comment out these two lines.
      </p>
    </blockquote>
    <blockquote>
      <p>
        Several other settings in <code>macports.conf</code> have
        changed their defaults over the years. Take a moment to compare
        each line of your <code>macports.conf</code> with the
        corresponding line in <code>macports.conf.default</code> in the
        same directory. Unless you know a reason why a line in your
        settings file should be different from the defaults, adopt the
        line from the defaults file.
      </p>
    </blockquote>
    <ol start="3">
      <li><span class="wikianchor" id="ports"><strong>Reinstall your
            ports</strong><a class="anchor"
            href="https://trac.macports.org/wiki/Migration#ports"
            title="Link to #ports"></a></span>
        <ol class="loweralpha">
          <li>Save the list of installed ports:
            <pre class="wiki">port -qv installed > myports.txt
</pre>
          </li>
          <li>Save the list of requested ports:
            <pre class="wiki">port echo requested | cut -d ' ' -f 1 | uniq > requested.txt
</pre>
          </li>
          <li>Uninstall all installed ports:
            <pre class="wiki">sudo port -f uninstall installed
</pre>
          </li>
          <li>Run a regular clear out of your installation:
            <pre class="wiki">sudo port reclaim
</pre>
          </li>
          <li>Download and execute the <a class="ext-link"
href="https://raw.githubusercontent.com/macports/macports-contrib/master/restore_ports/restore_ports.tcl"><span
                class="icon">​</span>restore_ports script</a>. (If you
            installed MacPorts from source and used a custom prefix,
            then you'll need to use the -p option when you run
            restore_ports.tcl; see <code>./restore_ports.tcl -h</code>.)
            <pre class="wiki">curl --location --remote-name <a class="moz-txt-link-freetext" href="https://github.com/macports/macports-contrib/raw/master/restore_ports/restore_ports.tcl">https://github.com/macports/macports-contrib/raw/master/restore_ports/restore_ports.tcl</a>
chmod +x restore_ports.tcl
xattr -d com.apple.quarantine restore_ports.tcl
sudo ./restore_ports.tcl myports.txt
</pre>
            Note: ports that are not available on your new platform will
            be skipped, with only a warning message. <br>
          </li>
          <li>Restore requested status:
            If you saved the list of requested ports, you can now
            restore the requested flags for your newly installed ports
            to their former states.
            <pre class="wiki">sudo port unsetrequested installed
xargs sudo port setrequested < requested.txt
</pre>
            Warning: if a port in <code>requested.txt</code> was <em>not</em>
            installed in the previous step, the iterative <code>setrequested</code>
            will terminate, leaving some ports still marked as
            not-requested. Edit <code>requested.txt</code> to remove
            any ports that were not installed and repeat this step.
            Double-check your desired ports are set as requested with <code>port
              echo requested</code>.
          </li>
        </ol>
      </li>
    </ol>
    <p></p>
  </body>
</html>