Skip to content

pymobiledevice3 backup2

Create, inspect, and restore MobileBackup2 backups.

backup

Backup device.

All backup data will be written to BACKUP_DIRECTORY, under a directory named with the device's udid.

pymobiledevice3 backup2 backup [OPTIONS] {backup_directory}

Arguments:

Argument Description
backup_directory [required]

Options:

Option Description
--full / --no-full Force a full backup and discard previous local backup state. By default, backup is incremental when valid local metadata exists, and automatically becomes full for an empty or incomplete backup directory. [default: no-full]
--only <bookmarks\|call_history\|contacts\|messages\|sms\|whatsapp> Preserve only selected backup payload presets. Repeat to keep multiple presets.
--only-regex <str> Preserve only backup payloads whose device path or manifest path matches this regex. Repeat to keep multiple regexes.
--patch-manifest / --no-patch-manifest Remove entries for discarded payloads from Manifest.db. Encrypted backups require --password when this option is used. [default: no-patch-manifest]
-p, --password <str> Backup password.
--unback Also unpack the completed backup locally using pyiosbackup. Existing unpacked contents are replaced. Filtered backups require --patch-manifest.

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

restore

Restore a backup to a device.

The backup will be restored from a directory with the device udid under BACKUP_DIRECTORY.

pymobiledevice3 backup2 restore [OPTIONS] {backup_directory}

Arguments:

Argument Description
backup_directory [required]

Options:

Option Description
--system / --no-system Restore system files. [default: no-system]
--reboot / --no-reboot Reboot the device when done. [default: reboot]
--copy / --no-copy Create a copy of backup folder before restoring. [default: no-copy]
--settings / --no-settings Restore device settings. [default: settings]
--remove / --no-remove Remove items which aren't being restored. [default: no-remove]
--skip-apps / --no-skip-apps Do not trigger re-installation of apps after restore. [default: no-skip-apps]
-p, --password <str> Backup password.
--source <str> The UDID of the source device.

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

info

Print information about a backup.

pymobiledevice3 backup2 info [OPTIONS] {backup_directory}

Arguments:

Argument Description
backup_directory [required]

Options:

Option Description
--source <str> The UDID of the source device.

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

list

List all file in the backup in a CSV format.

pymobiledevice3 backup2 list [OPTIONS] {backup_directory}

Arguments:

Argument Description
backup_directory [required]

Options:

Option Description
--source <str> The UDID of the source device.

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

unback

Convert all files in the backup to the correct directory hierarchy.

pymobiledevice3 backup2 unback [OPTIONS] {backup_directory}

Arguments:

Argument Description
backup_directory [required]

Options:

Option Description
-p, --password <str> Backup password.
--source <str> The UDID of the source device.

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

extract

Extract a file from the backup.

The file that belongs to the domain DOMAIN_NAME and located on the device in the path RELATIVE_PATH, will be extracted to the BACKUP_DIRECTORY.

pymobiledevice3 backup2 extract [OPTIONS] {domain_name} {relative_path} {backup_directory}

Arguments:

Argument Description
domain_name [required]
relative_path [required]
backup_directory [required]

Options:

Option Description
-p, --password <str> Backup password.
--source <str> The UDID of the source device.

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

encryption

Set backup encryption on / off, or report the current encryption state when run without arguments.

When on, PASSWORD will be the new backup password. When off, PASSWORD is the current backup password.

pymobiledevice3 backup2 encryption [OPTIONS] [mode]:<on|off> [password]

Arguments:

Argument Description
mode:<on\|off>
password

Options:

Option Description
-b, --backup-directory <directory> [default: .]

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

change-password

Change the backup password.

pymobiledevice3 backup2 change-password [OPTIONS] {old_password} {new_password}

Arguments:

Argument Description
old_password [required]
new_password [required]

Options:

Option Description
-b, --backup-directory <directory> [default: .]

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

erase-device

Erase all data on the device.

pymobiledevice3 backup2 erase-device [OPTIONS] {backup_directory}

Arguments:

Argument Description
backup_directory [required]

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.