1. In regards to recently combined carrier specific root forums, if your device forum was affected, please see this poll/thread!

[GUIDE] to Retaining Data After Flashing a New ROM

  1. Artine

    Artine Well-Known Member Contributor

    Since it doesn't appear to be widely known (and this is mostly for Newcomers, but could be for Veterans as well), most of us believe that you have to lose your data when flashing a new ROM in order for it to work properly. And, to top it all off, trying to restore anything with Titanium Backup post-new-ROM-flash doesn't appear to work correctly for most of us either. And, if you don't format/wipe /data, then your phone could likely get into a bootloop or have other weird issues.

    There is good news, however, as there is a way to circumvent these problems and inconveniences. The following applies to all ROMs, but only if your flashing a ROM for the first time or are changing from one ROM to another. This also only applies to like-for-like Android versions; in other words, Gingerbread -> Gingerbread, not Gingerbread -> Ice Cream Sandwich. If you're merely updating your existing ROM to a newer build, you can completely ignore this Guide entirely as your data will be unaffected since you don't have to format it for an update:
    1. Take all necessary steps to prepare for flashing your ROM of choice.
      • Such as wiping the /cache and dalvik-cache, making a Nandroid backup, and then wiping /system and /data in CWM.
    2. Flash the ROM in CWM, as usual.
    3. In CWM, select the Reboot Recovery option, located under Advanced in the Main Menu, to reboot the phone with the new ROM installed, but right back into CWM.
    4. From here, go to backup and restore -> advanced restore -> choose your most recent Nandroid backup from the list -> then choose Restore data.
    5. Head back to the main menu of CWM, and wipe/format the cache.
    6. From the main menu of CWM, go to Advanced -> Wipe dalvik cache.
    7. Next, from the Advanced menu in CWM, go to Fix Permissions.
    8. Head back to the main menu of CWM and select reboot system now.
    9. Your phone will have the new ROM installed, all of your data has been retained, and the ROM and phone shouldn't have any problems.

    YoFrankyG, ebop66, NetSpeedZ and 11 others like this.
  2. M0NSTER

    M0NSTER Well-Known Member

    i just flashed my rom then rebooted can i still keep my data? formatted my data then flashed my ROM then rebooted. can i just reboot into CWM and follow these steps?
  3. Artine

    Artine Well-Known Member Contributor

    It already says to do just that. Follow the steps :)
  4. PilotBob

    PilotBob Well-Known Member


    thanks for this info. does step 1 affect the data on the external SD card at all? I assume not considering that's where I assume the nandriod backups and such are placed?

    Would step 7 be use Titanium Backup to restore your apps?

  5. Artine

    Artine Well-Known Member Contributor

    No, neither SD card is touched. Just the /data partition.

    That's why there's no step 7. You shouldn't be using Titanium Backup to restore anything after switching to a new ROM - it's a known problem that the restoration doesn't work and cause/will cause problems. Also, once your data has been restored, there's no need to use Titanium Backup for anything post-new-ROM, because all of your data has already been restored :)
    PilotBob likes this.
  6. PilotBob

    PilotBob Well-Known Member

    After flashing this ROM when I choose reboot device in CEM I get the prompt:

    ROM may flash stock recovery on THIS CAN NOT BE UNDONE. Do I chose yes or no here?
  7. Artine

    Artine Well-Known Member Contributor

    Flashing which ROM? Stock? If it's prompting you for Sleipnir, it's fine. The install-recovery.sh script was modified to provide partial functionality for init.d scripts, and as that's the only code in the file it won't cause CWM to be overwritten with the stock recovery.
  8. PilotBob

    PilotBob Well-Known Member

    Sorry, thought I put this in the Sleipnir thread so yes.

    Should I answer NO or YES to this prompt? I've been answering NO and so far so good.

  9. amaranthine

    amaranthine Well-Known Member

    I didn't answer anything, just pressed the back button when confronted with the "yes or no" choice and the phone rebooted. My data was saved, but Sleipnir kept re-booting every few minutes, so I've decided not to keep my data and just re-flash it clean. My phone had re-booting issues with past versions of Sleipnir, but I'll give a clean install a try before going to Harmonia.
  10. Artine

    Artine Well-Known Member Contributor

    You can hit yes and CWM will not be overwritten, as there's nothing telling it to be overwritten.

    There's a known cause for that, which is either that data was not wiped before switching ROMs, or the phone is unstable while overclocked. I would suggest doing a clean install, which is done by first verifying that the build is correct for your carrier, the MD5 matches what it should, and making a Nandroid backup after wiping the /cache and dalvik-cache manually. Then wipe your /data, then flash the Sleipnir build. Then reboot back into recovery, and do an advanced restore from your earlier Nandroid backup, and restore only /data. Then reboot normally. Change the overclocked frequency of the CPU from 1.6GHz down to where the phone is stable, and you're good to go.
    amaranthine likes this.
  11. amaranthine

    amaranthine Well-Known Member

    Thanks for the instructions! I prefer starting over with a clean phone anyways. I was just trying out the restore data idea to see how it worked. I'll keep this in mind if I want to keep my previous data for a new flash.
  12. LowEndGeek

    LowEndGeek Well-Known Member

    Just curious what issues people have with titanium on this phone? Been using it since... Well forever but with this phone since I've rooted and I've yet to have a single problem
  13. Artine

    Artine Well-Known Member Contributor

    1. Titanium Backup backs up apps and data on Harmonia (for example).
    2. Wipe /data.
    3. Flash Sleipnir (for example).
    4. Reboot and restore your apps and data with Titanium Backup.
    5. TiB fails, hangs, and/or causes other problems.
    It doesn't seem to happen to everyone, but for a lot of people it ends up being the case. With restoring the entire data partition, however, you get everything back without the bootlooping or other problems.
  14. LowEndGeek

    LowEndGeek Well-Known Member

    Strange, sounds kind of like what would happen if you try to restore system data and not just personal
  15. Artine

    Artine Well-Known Member Contributor


    This is just an update: There may be a way to have Titanium Backup work correctly post-ROM switching, by going into Titanium Backup and then Preferences -> Migrate System Data. Anyone up for testing? :D
  16. starkraving

    starkraving Well-Known Member

    Good tutorial. Everybody keep in mind that not every device perfoms the same or behaves the same. They all may look alike but I assure you every device from entry level to super phones reacts different to flashes, restores etc. Good write up @Artine.
    Artine likes this.
  17. cfreeman90

    cfreeman90 Well-Known Member

    I'm willing,...seeings how I'm a serial flasher....lol
    Artine likes this.
  18. miediev

    miediev Well-Known Member

    It might be good to note that this method doesn't always work when restoring data from a rom that's based on a different version of android; from GB to ICS for example. In my experience, even from different AOSP roms based on the same android version. I'm not sure how far apart two roms have to be for these problems to start, but it's best to be aware. I think it's best to first start up a new rom without restoring data, to make sure everything works.
  19. AndroidHaCks

    AndroidHaCks Well-Known Member Contributor

    It is also good to wipe dalvik cache after you restore your data
    Artine likes this.
  20. Artine

    Artine Well-Known Member Contributor

    That's a good point, and I have updated the guide accordingly.

    Also a good point, and the guide has been updated with that note as well.
  21. kaybee99

    kaybee99 Member

    How do you do a nandroid backup? I only know how to back up on my cw
  22. miediev

    miediev Well-Known Member

    That is a nandroid backup. You already knew how, you just didn't know it ;)
  23. PizzaBandit

    PizzaBandit Member

    Date restore per steps worked perfect, thanks!
  24. redace

    redace Member

    Tried the exact steps after installing Sleipnir but somehow i get reboots constantly after i update the data. It boots into sleipnir and takes a long time and then when it boots into the main screen after a few minutes boots back again into Sleipnir screen.

    Maybe doing something wrong but clarification might help out

    Head back to the main menu of CWM, and wipe/format the cache.
    In this do you mean wipe cache in the main menu and then go to mounts and format cache there?

    Head back to the main menu of CWM and select reboot system now.
    when i reboot system it asks something about recovery flash, should i be saying yes to this?
  25. bigbpc

    bigbpc Active Member

    Perhaps reflash and give this a shot.
    Dark One and redace like this.

Share This Page