How can I export text substitutions from Lion for import into Mountain Lion
Thanks to Sacrilicious identifying the actual file/key where the data is stored, I figured out how to copy the whole thing with a few Terminal commands.

Make sure you don't have System Preferences open while doing this, or it may not work!


On your old install, run /usr/libexec/PlistBuddy -x -c "Print NSUserReplacementItems" ~/Library/Preferences/.GlobalPreferences.plist &gt; backup.plist

This saves the substitutions to the backup.plist file in whatever directory you ran that command from (by default, your home directory).

Copy that backup.plist file to your new install (I recommend your home directory for simplicity).
On the new install, run /usr/libexec/PlistBuddy -c "Delete NSUserReplacementItems" ~/Library/Preferences/.GlobalPreferences.plist, then run /usr/libexec/PlistBuddy -c "Add NSUserReplacementItems array" ~/Library/Preferences/.GlobalPreferences.plist

This wipes the default substitution list and creates a new blank one.

Again on the new install, run /usr/libexec/PlistBuddy -c "Merge /PATH-TO-BACKUP/backup.plist NSUserReplacementItems" ~/Library/Preferences/.GlobalPreferences.plist, first replacing the /PATH-TO-BACKUP/backup.plist part with the actual path to wherever you saved the backup file.


That should do it. Open System Preferences to double check, but you should have an identical copy of your text substitutions on your new install.