MotoBackup - Backup your Motorola cellphone

Hugh Sparks
Version 1.8, Oct 25, 2005

Introduction

I wanted a simple program to backup, restore and maintain the
phonebook in my Motorola V60c. I tried several freely available
programs, but none worked for me. After searching in
vain all over the Web for documentation on the command set,
I painfully resorted to thinking.

The results are here: a simple pair of programs to backup
and restore your phonebook. MotoBackup will read
all the phonebook entries in your phone and write them
to an XML file. The MotoRestore program will read
this file and restore the entries to your phone.

Over a period of years, the program has been evolved and
updated to support most of the Motorola V-series phones.

Downloads

Unless you have a special problem, you will want to download
the most recent version of the program. This web page aways
documents the features found in the most recent version. The
change log
explains the differences between the versions.

Using the programs

Finding your phone

Configuring and using MotoBackup and MotoRestore is
very easy. Getting your computer to talk to the phone on a serial
port is the hard part. There are two more or less difficult steps
involved: 1) Installing and configuring the driver. (Serial, USB,
or Bluetooth.)
2) Figuring out which port
is connected to the
phone. If these ideas are very familiar to you and you already
know the port and speed settings, simply continue to the next
section. The links above cover these issues in greater depth.

Note: You must disconnect any terminal emulator you may
have used to find the phone before running the backup or restore
programs.

Configuring and running MotoBackup

I will assume that you've got the phone connected to the
computer and that you know which port and baud rate settings
are appropriate.

To test your connection and parameters for the first time,
try running the program from a Command Window. Open the
Windows command window and navigate to the directory where
you put MotoBackup.exe.

Run the program by typing a command of this form:

MotoBackup fileName serialPort baudRate

For example, my Bluetooth connection appears on COM3,
so I would use this line:

MotoBackup Phonebook.xml com3: 115200

In each example, please note the colon at the end of the
comm port specification: It is a required part of the name.

If you have a serial cable connected to com port 1
on the back of your computer, you would use:

MotoBackup Phonebook.xml com1: 19200

Actually, the previous example would work correctly
with no parameters because the values shown are the
defaults.

When you run the program, the following sequence of
displays will occur:

Contacting the phone

Reading the phone entries

Writing the phonebook file

If there is a configuration problem, the program will probably timeout
trying to contact the phone. If this occurs, review the previous
sections and pages on drivers, locating, and testing the connection.

Using a shortcut

Most users will need to specify parameters. It is best to create a shortcut
that runs the program with the required parameters automatically.
To do this, right-click on the MotoBackup.exe program icon and select
Create Shortcut. A new file will appear called "Shortcut to MotoBackup.exe".
Right-click on the shortcut and select Properties. A dialog window will
appear. Select the "Shortcut" tab:

Example shortcut configuration

In the editable text box for the Target you will see the full path to the
MotoBackup.exe program on your machine. To specify values for the parameters,
just add them to the end of this string as shown in the example above.

MotoRestore

When you run MotoRestore, it will try to open the file Phonebook.xml
in the directory where the program is located and write all the entries
to the phone.

You can also test MotoRestore from the command line. The procedure
and parameters are exactly the same as those shown above for
MotoBackup.

You can drag-n-drop any previously created phonebook.xml file
on top of your MotoRestore shortcut. It will copy the entries
to the phone and exit automatically.

When MotoRestore runs successfully, the following sequence
of displays will occur:

Contacting the phone

Backup the phone entries

Write new entries to the phone

Erase unused entries in the phone

Viewing the phonebook file

The Phonebook.xml file has an associated stylesheet Phonebook.xsl.
If you have a recent web browser, you can simply double-click on the
Phonebook.xml file and a neatly sorted and formatted web page will
appear in your browser window.

The Phonebook.xsl stylesheet needs to be in the same directory with
your Phonebook.xml file for the browser to work properly.

Editing the phonebook file

The Phonebook.xml file may be edited using any plain-text editor
such as Windows Notepad or Linux "vi". If you modify the phonebook
file using a structured editor such as Microsoft Word, it will be
ruined.

Copying and merging entries

The Phonebook.xml file contains entries that have an index number.
The entries in the phone also have an index number: you see it as
the speed-dial number.

If you have only added entries to the phone, the index numbers
will be 1,2,...,N where N is the number of entries in the phone.
The next entry you add will have the number N+1.

When you delete an entry from the phone, the entry number is
"free": The next time you add an entry, this free number will
be used. (If you are a software type, think of the phonebook
as an array indexed by entry number.)

When you run MotoRestore, the entries in the file replace entries
in the phone that have the same number. If you add entries to the
file with new index numbers, MotoRestore will add them to the phone.
When editing the file by hand, it is easiest to add new entries at
the end, simply incrementing the index found in the previous entry.
It does no harm if a few free numbers go unused. The phone will
display the entries in alphabetical order no matter how the entries
are numbered.

The MotoRestore program is very picky about the phonebook file format.
If you edit the phonebook and the program complains, try viewing the
file with your web browser. It will tell you where to look for any
syntax errors.

Problems

Sometimes it helps to reconnect the USB cable or re-install the
USB serial driver. Bluetooth radio configuration is particularly
aggravating and beyond the scope of this introduction.

Note 1: I suspect that the phone "learns" what baud rate
to use by the first character to arrive on the input
port after it powers up. Your phone my get into a bad mood
if you try to connect again at a lower rate.

Note 2: The backup and restore programs will not work while the
terminal emulator is connected to the phone.

Note 3: The designers of Microsoft Windows could not conceive
of machines with more than 9 serial ports. As a consequence,
you cannot use conventional port names beyond COM9:
To deal with this oversight, newer versions of windows require
the following notation for port numbers beyond 9:

\\.\COM10
\\.\COM11
\\.\COM12
...
etc.

Note that these bizarre names do not end with a colon.

Getting rid of extra virtual modems

USB and Bluetooth connections create virtual modems that
like to change their numbers every time you connect your
phone. Consequently, you may find that you now have 10 or more
more com ports even if you only own one device.

I'm not entirely sure about how to avoid this problem because
I'm always experimenting with phones and other devices. It
may help to always use the same USB port when connecting your phone.

To clean up your superfluous ports, follow these steps:
Disconnect your USB cable from the phone. If you use a Bluetooth
connection, delete the whole device using the Bluetooth control
panel or task bar icon.

Open the Phone and Modems control panel, select the Modems tab
and delete all your extra modems. You'll want to keep your hardware
serial ports COM1: and COM2: and any real modem ports you've added
to your computer.

For Bluetooth phones, re-pair your phone using the Add Device
procedure on the Bluetooth control panel. You will automagically
get a new com port with a nice low number.

For USB phones, connect the cable. The New Hardware wizard dialog
will appear. Select the defaults and your old driver will be re-intstalled.
At this point, I find that I need to disconnect and re-connect the
cable again to get the modem to be visible to Hyperterminal and
MotoBackup. It will now have a new low port number.

MotoRestore hangs up or reports an error during restore

Certain characters cannot be used in phonebook entries.
This is becuase of the simple-minded XML parser used by
the program.

The program especially hates to see these characters
in phonebook names or numbers:

In the mean time, if your phonebook.xml file won't restore
properly, pay attention to the integer displayed by the progress
indicator when running MotoRestore. When it fails, fire up a
plain text editor and search around the entry with the
offending index number. You will find a forbidden character or
a truncated entry with no trailing quotation mark around the value.
Fix this, save the file and try to restore the phonebook again.

Voice-recognition numbers no longer work after using MotoRestore

This is a limitation imposed by the phone designers: There is no
way (as far as I know) to save and restore the voice recordings
used to recognize spoken names.

The recordings are associated with small integers in the internal
representation of the phonebook. But the phone will not allow
phonebook entries to be restored if these recordings are referenced
but not present on the phone. This will be the case when a phonebook
is restored to a new or accidentally erased phone.

Since this is the primary purpose of MotoBackup and MotoRestore, the only
alternative was to drop the references to voice recordings. Until I think
of a better way, you'll have to re-record them after a restore.

Using the program with other phones

So far, I've had good luck with all the Motorola
V-Series phones. Each time I get a new phone, I've had
to tweak the software a bit because my understanding of
the protocol has come from trial and error. Other
users of the program have also contributed many
discoveries.

The following phones are known or reported to work:

V60c - Works with a serial cable.
V60i - Reported to work.
V60t - Reported to work with USB.
V66 - Reported to work.
T730 - Works with Serial or USB
V551 - Works with USB or Bluetooth
V3 RAZR - Works with USB or Bluetooth
V220 - Reported to work

If you have success (or failure) with a different phone, please
send me a note and I'll post your results here.

How it works

How the program talks to the phone

The phones understand most of the Hayes modem "AT" commands.
They can be configured to function as generic modems with
Windows dialup networking.

In addition, there are a bunch of "AT+" commands that operate
the phonebook, datebook and many other features. MotoBackup
and MotoRestore use these special AT+ commands to read
and write the internal phonebook entries.

The phonebook file is a simple XML document. You can examine
or modify it using any plain-text editor. The parser used
by MotoRestore is not very smart so you can easily
break the file by adding white space and comments even if it
remains formally correct XML.