Over time, text messages and their attachments (photos, videos, etc.) can accumulate and take up a significant amount of space on both your iPhone and Mac. If you’ve been using your devices for years, you might notice that these files can easily take up over 50GB of storage. This guide walks you through the process of exporting and backing up your text messages, along with their attachments, so you can safely clear up space on your devices. ==== Steps ==== 1. **Install [[https://crates.io|Cargo]]:** curl https://sh.rustup.rs -sSf | sh 2. **Install imessage-exporter using Cargo:** cargo install imessage-exporter 3. **Install FFmpeg (or another MOV converter):** If you don't have FFmpeg installed, you may see an error about video conversion when exporting messages. Use [[https://brew.sh|Homebrew]] to install it: brew install ffmpeg 4. **Export Messages (by year or by quarter):** Use the following command to export text messages, including attached videos and pictures, from January 1, 2025, to March 31, 2025. The export will be saved in a folder named `2025-jan-mar` in your current directory: imessage-exporter -c clone -f html -o 2025-jan-mar -s 2025-01-01 -e 2025-03-31 For more parameters and options, refer to the [[https://github.com/ReagentX/imessage-exporter/blob/develop/imessage-exporter/README.md#how-to-use|official README]]. 5. **Set iPhone to Automatically Delete Messages Older Than 1 Year:** Go to **Settings > Messages** on your iPhone and enable the option to delete messages and attachments older than 1 year. For guidance, see the official Apple support article: [[https://support.apple.com/guide/iphone/delete-messages-and-attachments-iph2c9c4bfcb/ios|Delete messages and attachments]]. 6. **Backup Your Text Messages Every 3-6 Months:** Regularly export, zip, and back up your messages to keep your devices free from unnecessary data while retaining important memories.