Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

How to update with a custom build without losing all the data?

  • 5 replies
  • 7 have this problem
  • 1 view
  • Last reply by Enrico

more options

I have a ZTE Open I regularly update with custom builds. Every time I do this, I lose all of my data on the phone, such as contacts, installed apps from the Market store, settings (including wireless and email settings).

Recovering all of this data and settings every time is extremely annoying. Is there a way not to lose them in the process, or to save them and repristining them afterwards?

I have a ZTE Open I regularly update with custom builds. Every time I do this, I lose all of my data on the phone, such as contacts, installed apps from the Market store, settings (including wireless and email settings). Recovering all of this data and settings every time is extremely annoying. Is there a way not to lose them in the process, or to save them and repristining them afterwards?

Chosen solution

Hi Enrico,

I know that for importing/exporting contacts, you can use the following commands:

  • to export (pull) contacts:
adb pull /data/local/indexedDB/chrome db

This will store all the data of your device into a folder (in this case, called db) which will be created where you opened your shell.

  • to restore (push) them back to the device:
adb push db /data/local/indexedDB/chrome

The following Github repository offers some other tools and scripts for flashing, restoring, and backing up Gaia:

I've only tried backing up/restoring a couple of times in the past, but it didn't work as expected. Feel free to test them out with caution. =)

Thanks!!

- Ralph

Read this answer in context 👍 1

All Replies (5)

more options
more options

Thanks for the answer, vangelismsr!

Backing up the /data directory and then pulling it back after the update is a possible solution. I actually tried it once, but I was dissatisfied with it. It worked well as far as preserving my data, but then (if I recall correctly) the Device Information > More Information > Git commit info reported an old date. I think that pulling back the whole /data directory is too much, and you recover old parts (of Gaia, maybe?) you would prefer not to. Can anyone confirm my hypotesis?

It would be interesting to know precisely which parts of /data should be pulled back into the phone, if this is possible.

Another viable solution I can see is, the other way round, only flashing the parts you really want to. Though, I fear there is no way to flash Gaia without overwriting all of your data. On the other hand, not to update Gaia does not seems a good solution to me, does it?

I have no idea how to, but I think there should be a solution to this problem. After all, updates pushed by vendors update the whole OS without any data loss, don't they?

It is interesting the part about backing up contacts. I usually keep my Gmail contact list updated (manually, though, as there is no "export contacts to Gmail" function yet) and then import it all every time. It is still good to know, though, that backing up contacts is actually possible.

more options

This page on the Mozilla wiki gives some hints:

https://wiki.mozilla.org/B2G/QA/Tips_And_Tricks

In particular, this seems releted to the issue, even though I have not tried it yet:

https://wiki.mozilla.org/B2G/QA/Tips_And_Tricks#Backing_up_the_Profile_and_Restoring_it_after_flash

Though, it says: "To note : this works for the same version to same version. If you skip a version or if you're migrating from one version to the next, this may not work if it skips the database migration code of those apps." which seems to confirm that there is no simple way to preserves all of the user data, at least in general.

Maybe another solution could be to build incremental FOTA updates, as explained in

https://developer.mozilla.org/en-US/Firefox_OS/Building_and_installing_Firefox_OS/Firefox_OS_update_packages

but this process seems far to complicted to me. It is probably intended for vendors to push updates to all of their users, not for a single user to do it for himself.

I think this update issue is a terribly annoying problem: only by using custom builds (whose building process is not exactly user-friendly) I can have an updated ZTE Open device (sadly well-known for its lack of support from ZTE). Though, even this way the result is far from being optimal!

more options

Chosen Solution

Hi Enrico,

I know that for importing/exporting contacts, you can use the following commands:

  • to export (pull) contacts:
adb pull /data/local/indexedDB/chrome db

This will store all the data of your device into a folder (in this case, called db) which will be created where you opened your shell.

  • to restore (push) them back to the device:
adb push db /data/local/indexedDB/chrome

The following Github repository offers some other tools and scripts for flashing, restoring, and backing up Gaia:

I've only tried backing up/restoring a couple of times in the past, but it didn't work as expected. Feel free to test them out with caution. =)

Thanks!!

- Ralph

more options

Thanks, Ralph!

I tried the backup_restore_profile.sh tool and apparently it worked great: I backed up my data, flashed my old build on the device (which erased all of my data) and then restored everithing, including installed apps and settings.

I will try this with a new FFOS version (like 2.1) before declaring the problem completely solved.

EDIT: I'm not going to try flashing FFOS 2.1 on the ZTE Open anymore, since I'm now a proud owner of a Flame. The backup_restore_profile.sh tool seemed to work pretty well though, so I will mark the question as solved without further tests.

Modified by Enrico