Terminal shows hostname from old machine, not new machine
That part of the prompt is the hostname (\h) by default. Normally changing the computer name from System Preferences also changes the hostname:



The settings are stored in /Library/Preferences/SystemConfiguration/preferences.plist:

&lt;key&gt;Network&lt;/key&gt;
&lt;dict&gt;
    &lt;key&gt;HostNames&lt;/key&gt;
    &lt;dict&gt;
        &lt;key&gt;LocalHostName&lt;/key&gt;
        &lt;string&gt;Lauris-iMac&lt;/string&gt;
    &lt;/dict&gt;
&lt;/dict&gt;
&lt;key&gt;System&lt;/key&gt;
&lt;dict&gt;
    &lt;key&gt;ComputerName&lt;/key&gt;
    &lt;string&gt;Lauri’s iMac&lt;/string&gt;
    &lt;key&gt;ComputerNameEncoding&lt;/key&gt;
    &lt;integer&gt;0&lt;/integer&gt;
&lt;/dict&gt;


This changes the system hostname:

sudo scutil --set HostName My-MacMini


It adds &lt;key&gt;HostName&lt;/key&gt;&lt;string&gt;My-MacMini&lt;/string&gt; under System. If the system hostname has been set, changing the computer name or local hostname from System Preferences won't change the prompt.