SMS Backup & Restore stores its backups as XML. This page lists the attributes the app writes and reads. Newer versions of the app may add attributes. They are always optional, and existing attributes are never removed or renamed, so older backups can still be restored.

Backup file (root element)

Messages are stored in a <smses> element and call logs in a <calls> element. Both carry these attributes:

Attribute Description
count Number of records in the file. In an archive backup this is the old count plus the new records.
backup_set An id shared by all the files created in the same backup run.
backup_date When the backup was created, as a Java date in milliseconds.
type Only written by Archive backups, with the value archive.

The file also begins with an XML comment giving the app version and creation time. If the stylesheet option is on, an xml-stylesheet line points to sms.xsl or calls.xsl, which the app saves next to the backup.

SMS messages (<sms>)

Each SMS is a single <sms> element with no child elements. The app requires address, date, type, read and body when restoring.

Attribute Description
protocol Mostly 0 for SMS messages.
address Phone number of the sender or recipient.
date Java date representation (including milliseconds) of the time the message was sent or received. Check out www.epochconverter.com for information on how to do the conversion from other languages to Java.
date_sent The time the message was sent, in milliseconds. This can differ from date, which is when it was received.
type 1 = Received, 2 = Sent, 3 = Draft, 4 = Outbox, 5 = Failed, 6 = Queued.
subject Usually null for SMS messages.
body The message text.
toa, sc_toa Usually null.
service_center Service center number. Usually null for sent messages.
read 1 = Read, 0 = Unread.
status -1 = None, 0 = Complete, 32 = Pending, 64 = Failed.
locked 1 if the message is locked in the messaging app, otherwise 0.
sub_id Identifier of the SIM / phone subscription the message belongs to.
readable_date Optional. Human-readable date, written only when "Add readable date" is on.
contact_name Optional. Contact name, written only when "Add contact names" is on. It is (Unknown) if the number is not a saved contact.
s_chat Only on Samsung RCS chat records. The value is 1.

MMS messages (<mms>)

An MMS is an <mms> element holding two child elements, always in this order: <parts> (the content) and then <addrs> (the participants). The message text and attachments are in the parts, not in the <mms> element itself.

<mms> attributes

Attribute Description
address The recipient(s). In a group conversation every participant is listed, joined with ~. The app works this out from the conversation (Android does not store it on the MMS), so it can be missing from older RCS backups. Programs reading the file should fall back to the <addr> elements.
date, date_sent The Java date representation (including millisecond) of the time. Check out www.epochconverter.com for information on how to do the conversion from other languages to Java.
msg_box Same values as the SMS type: 1 = Received, 2 = Sent, 3 = Draft, 4 = Outbox, 5 = Failed.
m_type 128 = Sent (send request), 132 = Received (retrieve confirmation), 134 = Delivery receipt.
read, status, locked, sub_id Same meaning as for SMS.
ct_t Content type, usually application/vnd.wap.multipart.related.
text_only 1 if the message contains no media.
m_size Message size in bytes.
m_id, tr_id Message id and transaction id. The app uses these to detect duplicates when restoring. On restore, a tr_id beginning with proto: is changed to begin with smsbr-, because Google Messages ignores messages that carry the original prefix.
restricted Marks messages that only the default SMS app can read (for example RCS / end-to-end encrypted messages).
readable_date, contact_name Optional, as for SMS. For a group message, contact_name is a comma-separated list of the names that were found. It may list fewer people than address and is empty if none were found, so don't match the two up by position.
Other columns The app also writes any other columns in your phone's MMS table (for example sub, sub_cs, ct_l, exp, pri, rr, resp_st). These vary between phones and Android versions, so don't rely on them.

<part> attributes (inside <parts>)

Attribute Description
seq Order of the part. -1 is the SMIL layout part.
ct Content type, for example text/plain, image/jpeg, video/mp4 or application/smil.
cl File name of the attachment.
text The message text, for text/plain parts.
data The attachment itself, base64-encoded. It is absent if media backup is turned off.
Other columns Other columns of the part table (for example name, chset, cid) are also written. Internal ids (_id, mid, _data) are not.

<addr> attributes (inside <addrs>)

Attribute Description
address Phone number or email address. The value insert-address-token is a placeholder for your own number.
type 137 = From, 151 = To, 130 = CC, 129 = BCC.
charset Character set of the address, usually 106 (UTF-8).

RCS addresses

  • Addresses ending in @rcs.google.com are RCS chats (mostly group chats) that Google Messages stores without real phone numbers. The real participants are in the <addr> elements.
  • Addresses ending in @bot.rcs.google.com are business ("bot") chats such as bank codes and verification codes. contact_name holds the business name, or (Unknown) in backups made by older versions.

Call logs (<call>)

Each call is a single <call> element. The app requires number, duration, date, type and presentation when restoring.

Attribute Description
number Phone number of the caller or the person called.
duration Length of the call in seconds.
date Java date representation (including milliseconds) of the time of the call.
type 1 = Incoming, 2 = Outgoing, 3 = Missed. Other values defined by Android (Voicemail, Rejected, Refused List and so on) are copied as stored.
presentation Caller ID status: 1 = Allowed, 2 = Restricted, 3 = Unknown, 4 = Payphone. Very old backups instead put -1, -2 or -3 in number; both forms are read.
subscription_id The SIM / subscription that handled the call.
subscription_component_name The phone account (calling app or SIM) that handled the call.
post_dial_digits Digits dialled after the call connected, such as an extension.
readable_date Optional. Human-readable date.
contact_name Optional. Contact name.

Compression and encryption

Compressed backups are .xml.zip files. The XML file is the first entry in the zip and has the same name without .zip. The zip can also be password-protected with AES-256 encryption.