Sunday, February 6, 2011

Backing up your N900 contacts to a remote site...

There are many ways to backup the contacts on the N900. This article suggests an almost foolproof way of backing up the contacts (and can be implemented for other things as well besides Contacts).

Things you need for this to work:

  1. The N900 has access to the internet (either from a data plan or via wifi).
  2. An email address that the N900 is configured to send/receive.
  3. The tar application on your N900 (found in the coreutils-gnu package via Application Manager).
  4. Data cable for the N900 or bluetooth between your N900 and your computer.

Exporting your contacts

You first run the Contacts application on your N900 and open the menu, select Export.

You will get the "Export contacts" wizard, tap "Next"
Select "All contacts", tap "Next"
Select "vCard 3.0", tap "Next"

Tap the "Location" bar and select your microSD card root ("/") location. Make sure the "Folder name" is "Exported contacts" and tap "Next"

The Contacts application will now export all your phone contacts. When the application says "Export contacts setup is complete.", tap "Finish"

You will then need to open a terminal shell session and type the following:

$ cd /media/mmc1
$ tar -zcvf n900-contacts.tar.gz Exported\ contacts/

If the TAR command runs without errors, you can safely remove the "Exported contacts" folder by typing in:

$ rm -r Exported\ contacts

To get out of the terminal session, type the command:

$ exit

You then run the E-mail application, and email yourself a copy of the n900-contacts.tar.gz file. That way, your contacts are kept safely in a remote location.

Importing your contacts

To import all your contacts back into your phone, you will need to download the n900-contacts.tar.gz file to your Ubuntu (any linux actually) desktop and extract the .tar.gz file content to the desktop. If done correctly, you will find a folder on your desktop called "Exported contacts".

Run a terminal shell session and type in the following commands:

$ cd
$ cd Desktop/Exported\ contacts/
$ cat *.vcf > TEMP
$ mv TEMP all-contacts.vcf
$ exit

You will now find a file called all-contacts.vcf in the "Exported contacts" folder and you will need to open it using gedit (installed by default in Ubuntu GNOME builds).

In gedit, invoke the replace feature by pressing CTRL-H. In the "Search for" field, type in "ENDVCARD" and in the "Replace with" field, type in "END\nVCARD". Make sure all four options "Match case", "Match entire word only", "Search backwords" and "Wrap around" are unchecked. Then hit the "Replace All" button.

Save the changes and send the file to your N900 either via data cable or bluetooth to your microSD card root ("/") folder.

Run the File Manager application and navigate to the microSD card's root folder, you will find a file called "all-contacts.vcf" and tap on it. You will be prompted if you want to "Import to Contacts?" and click "Yes".

Note: If you are restoring to new or recently flashed N900 this will restore all your contacts. However, if you already have contacts in your N900, they will appear as duplicates. To delete all your contacts in the N900 prior to importing from the all-contacts.vcf file, go to Contacts application, go to "Settings" and select "Delete all contacts from device".

No comments:

Post a Comment