-
Notifications
You must be signed in to change notification settings - Fork 4
Migrate to a new Mac
- Description
-
Prepare the provisioning
- Install Splinter in your old Mac
- Configure your custom profiles
- Set system preferences
- Export your current system preferences and dotfiles and app lists
- Create your list of non-MAS and non-Cask Applications
- Setup FileVault2 encryption
- Add custom profile and desktop background pictures
- Create the provisioning package
- Provision the new Mac
When migrating to a newer Mac, it is sometimes preferable to start with a clean installation rather than a Mac-to-Mac migration to avoid bringing with you clutter files and configurations, but with the perk of having your favourite settings and apps ready to go. For instance, when you think some virus or ad-ware might have compromised your machine.
You will prepare the provisioning in your old Mac and generate a provisioning package that you will copy to your new Mac to run the provisioning.
Follow the installation instructions.
In ./splinter/profiles/
you will find two initial example profiles:
- base
- example
Most commonly you will simply need to customise the
base
profile.
If you intend to create more than one new Mac with different personalisations then you can consider:
- customising the
base
profile with all the common settings - create a copy of the
example
profile for each new Mac to solely contains the settings that differ for each Mac.
The base
profile includes the full set of configuration files with the full set of configuration attributes set the most common desired values.
Each module has its own configuration file with its own attributes and toggles that you can customise.
base profiles structure
profiles/
│
└── base
│
├── current_user.yml
├── dotfiles.yml
├── extra_packages.yml
├── filevault_option.yml
├── homebrew.yml
├── mac_app_store.yml
├── macos_apps_list.yml
├── modules.yml
├── new_user.yml
├── post_provision.yml
├── sophos-endpoint.yml
├── ssh_config.yml
└── system_preferences.yml
All modules are disabled by default, you will need to:
-
Enable the modules for which you want to run the provisioning:
# file: <base_profile>/modules.yml configure_filevault: yes # Activate FileVault2, fine-tuning in filevault_options.yml configure_sophos_endpoint: no # Install Sophos Endpoint from your organisation configure_homebrew: yes # Install and Configure Homebrew to be used by all accounts configure_system: no # Set default settings for the operating system, fine-tuning in osx_config.yml configure_dotfiles: yes # Import your exported dotfiles (explained below) configure_extra_packages: no # you will restore your system preferences from and export of your current settings configure_setapp: no # Install SetApp application store and launch it, you will to sing-in and download your favourites manually from the app install_mas_apps: yes # Install apps from Mac App Store install_macos_apps: yes # Install apps from direct links: apps not available in Mac App Store or as a Homebrew Cask
Set
configure_system: no
because you will restore your system preferences from and export of your current settings -
Enable the restoration of you exported dotfiles and configurations
# file: <base_profile>/dotfiles.yml restore_preferences_and_dotfiles_from_export: no
./splinter export all
This command will export to ./files/lists
and ./files/preferences
the following files (if you have any of these subsystems installed):
files/preferences # your system preferences
# your application settings
# Dock and menu bar settings
# your Internet Accounts registered in System Preferences (iCloud, Google Accounts, etc.)
# all the dotfiles in your home dir
# and anything that Macprefs tool can backup (https://github.com/clintmod/macprefs)
homebrew_taps.txt # list of brew taps, packages and cask formulas
homebrew_cask_apps.txt
homebrew_packages.txt
ruby_gems.json # list of user-installed Ruby gems
mas_apps.txt # list of installed apps from MacAppStore
npm_global_packages.json # list of NPM packages
pip_packages.json # list of user-installed Python packages from Pip
These files will be used by Splinter to reinstall the same set of packages and apps
Most probably not all your applications are installed via MacAppStore or Homebrew Cask. We can fix that!
You can browse the list of applications available as Hombrew Cask formula and add your favourite applications to homebrew_cask_apps.txt
.
This will automate the installation of your favourite apps
You can configure a list of application for which you want to automate the installation even if they are not present in the Mac App Store or as a Homebrew Cask.
you can edit that list in
# file: <custom_role>/macos_apps.yml
macos_apps_install_list:
- { u: 'https://central.github.com/deployments/desktop/desktop/latest/darwin',
f: 'GitHubDesktop.zip',
n: 'GitHub Desktop',
t: 'zip',
}
- ....
To be honest, this is not the most straight forward system so I advise reading the documentation in the GitHub documentation from the developer of the ansible-macos-apps-install Ansible role
To enable FileVault2 set this in your base
profile:
# file: <base_profile>/modules.yml
configure_filevault: yes
This will generate a Personal Recovery Key that will be saved in the desktop of the new Mac (for you to store it in a safe place).
In case you want to use the same FileVault2 Master password for both your old and new Macs, you can consider using an Institutional Recover key explained here.
-
Copy the profile picture you want to assign to your new Mac account in
.jpg
or.png
formats into:`(splinter project)/files/profile_pictures/`
-
Copy your chosen desktop picture in
.jpg
or.png
formats into:`(splinter project)/files/`
-
Specify the
path/name
in the pictures files:# file: <base_profile>/current_user.yml current_user_profile_picture: "files/profile_pictures/my_profile_picture.png" current_user_desktop_picture: "files/desktop_pictures/custom_desktop_image.jpg"
Now that you have added all your custom settings, files, the export of your apps and system preferences to the project folder you can create a provisioning package that you will copy to your new Mac.
./splinter create package
This command will create (splinter project)/SplinterProvision.dmg
with a rough size of 600MB
-
Login in the new Mac with the account you will be using
-
Login into your iCloud account to allow Mac App Store apps installation:
a. Open
System Preferences -> Internet Accounts -> iCloud
b. Authenticate your iCloud account
-
Add the
Terminal
application (located in/Applications/Utilities/
) to the "Full Disk Access" policya. Open
System Preferences -> Security & Privacy -> Privacy -> Full Disk Access
b. Authenticate to unlock the list of allowed applications
c. Add
Terminal
to the list of allowed apps, save and close. -
Connect to a WiFi network.
-
Transfer a copy of the
SplinterProvision.dmg
provisioning archive from your old Mac to the new Mac:
- option 1: transfer the directory using
Share->AirDrop
(you need to make the new Mac discoverable byeveryone
). - option 2: transfer with a USB stick.
- Mount the provisioning archive
-
from the
Terminal
application access the mounted disk imagecd /Volumes/SplinterProvision
-
run
splinter
# You need to escape spaces when defining the user's full name ./splinter provision -h 'Computer-Name'
if you have set up a 'role' profile you can specify that with "-r <role_profile>"
-
Splinter will request you to enter the current user account (to be used as
sudo
password throughout the whole process).
The rest of the provisioning can be mostly unattended but a few applications might require some system privacy authorisation, for instance vagrant
and if you do not allow that in time and the installation fail you can re-run the brew
installation command or re-run splinter
During the deployment a few applications might request authorisation to run so do not leave the Mac completely unattended.
This applies only if you have installed Oracle's Virtualbox
-
Go to
System Preferences -> Security & Privacy -> General
-
Click the
Allow
button next to the request of authorisation for "Oracole America, Inc." software -
re-run VirtualBox installation, this time it should succeed without errors
brew cask reinstall VirtualBox
Note: if you want to create additional accounts check out the process to Create an additional account for your kids or partner
2020 (c) MarcoMC - github.com/marcomc/splinter