Backing up your contacts on FirefoxOS

25 July, 2013 § 21 Comments

I’ve been helping beta test B2G and subsequently FirefoxOS since October 2012.  Once in a while I’ve come across a bug that requires me to reset the phone back to its factory state. Unfortunately at this early stage there isn’t a built-in way to back up your data from a FirefoxOS phone. I’m sure it’s on a roadmap, but as with all v1 products you have to make some tough calls when it comes to feature prioritization.

This tutorial provides a step-by-step walk through of how to backup and restore your contacts on a B2G or FirefoxOS phone. It’s not supported so it may stop working in the future, but for now it works 🙂

To complete this tutorial you’ll need a B2G/FirefoxOS phone, a USB cable to connect your phone to your computer, and the Android Debug Bridge installed (referred to as `adb` later in the tutorial).

1. Start up your FirefoxOS phone and go to Settings.

step1

2. Go to Device Information

step2

3. Go to More Information

step3

4. Go to Developer

step4

5. Enable “Remote Debugging”. This will allow you to use ADB to pull data off of the phone.

step5

6. Connect your phone to the computer using the USB cable.

7. In your console, type `adb devices` to check that the phone has connected properly. You should see your phone listed as an attached device. At this point you can now use `adb shell` to browse through the system files on the phone.

8. Type `adb pull /data/local/indexedDB/chrome/3406066227csotncta.sqlite .` This will pull the contacts IndexedDB database off of your phone and in to your local working directory. If you are curious about the contents of the database, you can install the IndexedDB Browser add-on for Firefox which will let you open up the database.

2013-07-23_2109

And you are now done with backing up your contacts. If you need to reset your phone in the future, you can just follow these steps again but replace step 8 with the following: `adb push 3406066227csotncta.sqlite /data/local/indexedDB/chrome/3406066227csotncta.sqlite`. This will push your backed-up contacts database back on to the device.

Tagged: , , ,

§ 21 Responses to Backing up your contacts on FirefoxOS

  • Doug Reeder says:

    This is useful for techies, but it does hilight the lack of a backup mechanism in FFOS for user’s local data.

    • msujaws says:

      Sure, I agree. That’s why I mentioned in the post that I’m sure that backup/export is most likely on a roadmap but just not here in a v1 product. That doesn’t mean that it won’t be coming in the future.

      When the phone is hooked up with Facebook’s contact sync this tutorial isn’t necessary, but I opted not to use Facebook’s contact sync in my phone.

  • Nice says:

    Nice. I don’t want to give this personal information to online companies and it’s nice to have an option to do the local backups.

    I am sure in the future it will be easier or to have something like CardDAV support with (local) server.

  • danielneis says:

    Hello,

    i’ve copied the file with adb, but the indexedDB extension breaks when tries to load it saying:

    Error: UnknownError’ (chrome://idbbrowser/content/browser.js:844)

    Also, in the version i was using (from february or march) had one more directory in the hierarchy, called idb. The full path was:

    /data/local/indexedDB/chrome/idb

    i’ve flashed my phone with the v1.1 version from geeksphone and tried to import contacts back and it didn’t work.

    any ideas?

    kind regards,
    Daniel

    • msujaws says:

      Because this is not a supported way to backup your contacts, I wouldn’t expect that you could export your contacts, update, and then re-import your contacts. You should probably see if you can downgrade to the version you were on previously and then import the contacts. Once the contacts are imported then you could try upgrading the OS version.

      As to the IndexedDB extension error, I’m not sure why that is happening. But you could try using Firefox Nightly with it.

      As to the difference in path, it is my understanding that the paths have changed through development, so that doesn’t surprise me. I’m glad you were able to find the file regardless 🙂

  • How to use it on linux platform? I have installed adb on ubuntu 13.04 but when i execute “adb devices” command i’m getting

    —————————————————————-
    krishna@kkdeep:~$ adb devices
    List of devices attached
    ???????????? no permissions
    —————————————————————-

    This as output.

  • me says:

    Here’s the bug where CardDAV support is being tracked:

    https://bugzil.la/859306

  • Daniel says:

    I have a ZTE Open and the describes procedure fails:

    > adb pull /data/local/indexedDB/chrome/3406066227csotncta.sqlite .
    remote object ‘/data/local/indexedDB/chrome/3406066227csotncta.sqlite’ does not exist

    The Firefox OS version is 1.0.1.0

    The ZTE Open is not that open as the name suggests; it is quite “closed”; I can not browse through /data and look for the right pathname.

    Has everybody a good idea how to backup the contact list?

    • I do have the same problem with my ZTE open.
      Seems like there is a permission issue with the /data directory but I don’t know how to solve that issue…

    • Simulty says:

      I am having the exact same issue. If i run “adb shell”, and then “ls /data” I get permission denied.

      Did you ever find a way to export the contacts?

  • Rik24d says:

    Note that starting with 1.2, the storage moved to /data/local/storage/persistent/chrome/idb. Adapt your scripts accordingly 🙂

  • Rik24d says:

    Also, if you already are on 1.2 or newer, we now have an export feature to the SIM card and SD card. And an import feature 🙂 A bit less obscure.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

What’s this?

You are currently reading Backing up your contacts on FirefoxOS at JAWS.

meta

%d bloggers like this: