X
Tap here to go to the mobile version of the site.

Support Forum

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

Posted

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

Additional System Details

Application

  • User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:32.0) Gecko/20100101 Firefox/32.0

More Information

vangelismsr 0 solutions 8 answers
Hi friend here are some links you might want to take a look at. Its the only thing possible right now.... https://developer.mozilla.org/en-US/Firefox_OS/Firefox_OS_build_prerequisites#Backup_the_phone_system_partition http://firefoxosguide.com/firefox-os/how-to-backup-contacts-on-firefox-os-device-step-by-step-tutorial.html/

Question owner

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.

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.

Question owner

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!

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!
Ralph Daub
  • Administrator
158 solutions 1182 answers

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

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: * [https://github.com/Mozilla-TWQA/B2G-flash-tool] 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

Helpful Reply

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.

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