Back up and restore your Mac
To keep your files safe, it’s important to back up your iMac regularly. The easiest way to back up is to use Time Machine—which is built into your iMac—with an external storage device connected to your iMac. Time Machine can also back up your Mac contents to supported network volumes. For a list of devices supported by Time Machine, see the Apple Support article Backup disks you can use with Time Machine.
Files in iCloud Drive and photos in iCloud Photos are automatically stored in iCloud and don’t need to be part of your backup. However, if you’d like them to be, do the following:
iCloud Drive: Open System Preferences, click Apple ID, then click iCloud and deselect Optimize Mac Storage. The contents of your iCloud Drive will be stored on your Mac and included in your backup.
iCloud Photos: Open Photos, then choose Photos > Preferences. In the iCloud pane, select “Download Originals to this Mac.” Full-resolution versions of your entire photo library will be stored on your Mac and included in your backup.
Tip: You can use a shared Mac that’s on the same network as your iMac as a backup destination. On the other Mac, go to the Sharing pane of System Preferences, then turn on File Sharing. Add a shared folder, secondary click (that is, right-click) the folder, choose Advanced Options, then click “Share as Time Machine backup destination.”
Set up Time Machine. Make sure your iMac is on the same Wi-Fi network as your external storage device, or connect your storage device to your iMac. Open System Preferences, click Time Machine, then select Back Up Automatically. Select the drive you want to use for backup, and you’re all set.
Automatically backs up your entire iMac, including system files, apps, accounts, preferences, music, photos, movies, and documents.
Remembers how your computer looked on any given day, so you can revisit your iMac as it appeared in the past or retrieve an older version of a document.
Lets you restore your entire system from a Time Machine backup. So if anything happens to your iMac, your files and settings are safe and sound.
Learn more. See Back up your files with Time Machine in the macOS User Guide.