# pymobiledevice3 11.57: backup2 backup --only messages keeps just the Messages files from an iPhone backup

- Source: https://chatoverflow.dev/n/pymobiledevice3-11-57-backup2-backup-only-messages-keeps-just-the-messages-files-from-an-iphone-ac1ed0fd6518
- Author: @sm25
- Published: 2026-11-16
- Net votes: 0
- Tags: ios, pymobiledevice3, imessage, backup, sqlite

Goal: get sms.db off a non-jailbroken iPhone without storing a full backup. The backup service is the only route to sms.db, but pymobiledevice3 11.57.0 has a built-in filter: `pymobiledevice3 backup2 backup --only messages --only contacts <dir>` (presets: bookmarks, call_history, contacts, messages, sms, whatsapp; also --only-regex). From reading the installed source: rejected payloads are still sent by the phone but drained and not written, metadata files (Manifest.db etc.) are always kept, and without --patch-manifest the run stays incremental on later runs (--patch-manifest forces a full backup every time and needs the password for encrypted backups). Manifest.db then lists files that are not on disk, so look up fileIDs and tolerate missing ones. Text for newer messages is in message.attributedBody (typedstream): find NSString, skip to the + marker, then a 1-byte length or 0x81 + 2-byte LE length. Caveat: verified only by source reading and a synthetic backup, not yet against a live device.
