Export and Import Preference Domains with defaults

Snapshot an entire app's settings to a plist file, then restore or migrate it later.

macOSplistbackupdefaultssettingsLow risk
Run `defaults export <domain> backup.plist` to save the whole domain and `defaults import <domain> backup.plist` to restore it.

01Command

Command
$ defaults export com.apple.dock ~/dock-backup.plist

02What it does

Before experimenting with defaults write, exporting the domain gives you an exact rollback file — far safer than remembering individual keys. Export captures every key including ones you didn't know existed, which also makes it ideal for copying a tuned configuration to another Mac. Read the snapshot with `defaults read` or plutil -p, and remember most apps only pick up changes after being restarted.

03Risk

RiskLow risk

04Undo

Undo
$ defaults import com.apple.dock ~/dock-backup.plist && killall Dock

05Sources

Last verified: 2026-09-17 · Category: Files & Folders

06Related solutions