🔒 Patreon Special

IT Pros: exclusive shows await you on Patreon, focusing on the more challenging aspects of running your practice and working with clients and employees.


Export VPN Configurations when migrating to a new Mac

VPN Configurations are among the few things not automatically migrated by Migration Assistant when switching to a new Mac. As Apple Consultants, we often have dozens of VPN connections to client networks conveniently listed in the VPN menu. With one-click access to client networks, we're ready to connect and provide remote support at a moment's notice.

After successfully migrating to a new Mac, there's a certain kind of "cobbler's kids" dread the first time you instinctively reach for the VPN menu and find none of your familiar connections listed.

Here's a quick-and-dirty Automator workflow I put together to help migrate VPN configurations when switching to my new MacBook Air a couple of years ago.

Preparation

  1. Open System Preferences > Network, and click the lock to authenticate if necessary.
  2. Select the first VPN connection in the service list.
  3. Click the gear below service list, and choose Export Configurations.
  4. Select the "Export the default configuration" and "Include items from the system keychain" checkboxes.
  5. Navigate to a folder of your choosing, or create one – this folder will be used by the Automator workflow to save each of the exported VPN configurations. Click Save.

Export VPN Configurations

  1. Download the Export VPN Configurations Automator workflow and put the application in your Dock (temporarily) to make it easier to access.
  2. Open the Export VPN Configurations app in your Dock. The first time you open it, you will get an error that the action Watch Me Do encountered an error. Open System Preferences > Security & Privacy, and check the box on the Privacy tab to allow Export VPN Configurations to control your computer.
  3. Make sure the second VPN connection is selected in System Preferences > Network (you've already exported the first one in the preparation steps above).
  4. Click the Export VPN Configurations app in your Dock to run it.
  5. After the workflow runs, the next VPN connection will be selected automatically. Run the workflow again to export the next VPN connection, and repeat until you've exported all of your VPN connections.

Import VPN Configurations

Perhaps this could benefit from some automation, but I will leave that as an exercise for the reader.

  1. Copy the folder where you saved your VPN configurations to your new Mac.
  2. Open System Preferences > Network, and click lock to authenticate if necessary.
  3. For each VPN configuration: Click the plus (+) below the service list on the left, and add a new VPN interface with the correct type (L2TP over IPSec, PPTP, or Cisco IPSec) and name it accordingly, e.g. "Client A VPN (L2TP)."
  4. Open each VPN configuration file you copied to your new Mac, and choose the corresponding interface you created in step 3.