Wednesday, June 22, 2011

Upgrading from CyanogenMod 6.1 to 7

I've been running CyanogenMod 6.1 pretty much since it came out last year. It's served me extremely well and I've had very few problems with it. However, I bought a new 16Gb class 10 SD card a while ago which I wanted to replace for the existing one and have been itching to get me some Gingerbread action since Cyanogen moved up to version 7 a couple of months back.

Several things put me off doing it sooner. I had apps2ext set up (using the command line tool by DarkTremor) and I'd read some reports about compatibility issues between CM7, DT and some versions of ClockworkMod. There was also a suggestion that you couldn't use Titanium Backup to upgrade apps and data from CyanogenMod 6 to 7. Plus the fact that the only reliable source of information on these sort of things is the XDA forums, where most of the relevant threads run to over 100 pages, meant that it was never going to be a very quick process!

(I should point out before I go any further, just for the benefit of anyone reading this who is unfamiliar with the whole custom ROM thing on Android - what I'm talking about here is not the standard method of upgrading an Android phone to a newer version! If you stick to the standard ROM that comes preinstalled on your phone, as 99% of people do, then upgrading is pretty much a one-click affair. Custom ROMs, on the other hand can be a bit trickier to deal with, especially when you start messing around with extra hacks like apps2ext. But I'm a sucker for punishment. Or, more accurately, I'm still using a phone - the HTC Desire - with a relatively small internal storage and I like to have a lot of apps, so the built in apps2sd isn't enough.)

Anyway, after eventually getting to the point where I felt I knew enough to take the plunge, I wrote a bulleted list of things to do, just to make sure I didn't miss anything along the way. It looked something like this:
  • Use Gparted on Linux to format new SD card with 15GB FAT32 and 1GB ext3 partition
  • Make sure all phone apps/data backed up in Titanium 
  • Boot into recovery and do full Nandroid backup to old SD card 
  • Back up old SD to computer (using Linux to include ext3 partition) 
  • Take out old SD card 
  • Download CM7, GApps & DarkTremor to computer 
  • Copy CM7, GApps & DarkTremor to new SD card 
  • Insert new SD card into phone 
  • Boot into recovery and do factory reset/full wipe (but not SD card!) 
  • Install CM7 from SD (still in recovery) 
  • Install GApps from SD 
  • Reboot and sign in to Google 
  • Reboot into recovery 
  • Install DarkTremor 2.7.5.2 
  • Reboot 
  • Open terminal and run DarkTremor commands: su, a2sd cachesd 
  • Reboot 
  • Copy SD card contents (FAT32 partition) from computer to new SD card in phone 
  • Restore apps and data using Titanium
Simple enough right?! That's when the fun started...

Partitioning the new SD card was fairly straightforward. I followed this guide on XDA (ignoring the bit about creating a disk image to run Gparted on Windows as I was using Linux).

Next I backed up all my apps, app data and system data using Titanium Backup (just in case there was a chance I could restore anything from it after I'd upgraded), then rebooted the phone into recovery. (I'm currently using ClockworkMod 2.5.0.7. There's a newer version but reports suggested it didn't work well with DarkTremor so I stuck to the older version..

Once in recovery, I did a nandroid backup (for the uninitiated that's a full system backup saved to the SD card, which, if anything goes wrong, you can use to restore your phone to the exact state it was in previously).

I powered off, took the SD card out of the phone and copied all the files from it onto the computer. Then I downloaded the latest stable version of CyanogenMod 7 (7.0.3) for the HTC Desire, plus the latest recommended Google Apps package, and the latest stable version of DarkTremor. Then I copied these onto the new SD card along with the Titanium Backup folder off the old SD card before inserting it into the phone and booting into recovery.

In recovery, I performed a factory reset to wipe the phone's internal storage. This feels like the point of no return (although it's not really, as I could have always reinserted the old SD card and done a nandroid restore to get everything back to its original state).

After rebooting into recovery again, I flashed CyanogenMod and Google Apps, before rebooting the phone fully.

Everything loaded up fine and I was prompted to enter my Google credentials. Having done so, and without going through the further steps of setting up Google sync etc, I powered off and booted back into recovery where I installed DarkTremor, then rebooted again.

Again everything was fine. I went through the setup process, then opened the Terminal Emulator app and ran the 'a2sd cachesd' command to tell DarkTremor to move apps and dalvik cache to the ext partition of the sd card. Another reboot, and all seemed fine again. I installed the 'Quick System Info' app to keep an eye on storage levels and also Titanium Backup to restore my apps.

However, I started running into issues like apps force closing or the phone randomly rebooting when I tried to install certain apps. I ended up doing a factory reset and starting again, but ran into the same problems. Initially I suspected it was Titanium causing the problems so I just used it to restore the apps rather than apps + app data, but this didn't seem to solve it. Another factory reset and more of the same. This time I thought perhaps it was DarkTremor causing the problems, so I installed an app called S2E (simple2ext) from the Market that does pretty much the same thing as DT (without some of the more advanced features I didn't use anyway) but with a nice simple to use GUI. But again the same problems cropped up. I decided the finger of blame must still be pointing at Titanium so after yet another factory reset I set about resintalling my apps but this time completely from scratch - I simply used the list of backed up apps in Titanium as reference, then installed and configured them manually from scratch.

This solved everything, so in the end I really should have just listened to the advice about not using Titanium to upgrade restore from CM 6 to 7! It was a pain, to be sure, as manually installing and reconfiguring over 100 apps is a big deal, especially when many of them are quite involved like Tasker, Launcher Pro and Titanium Media Sync.

However, several days later with everything back up and running and my normal sleep pattern restored, I was glad I upgraded. Gingerbread is so much nicer than Froyo, both in terms of visual gloss and performance. And CyanogenMod 7 adds a lot of really nice extra features and enhancements too. The only downside I've noticed so far compared to the previous version is that the auto brightness doesn't seem as responsive, but having said that there is a facility in CyanogenMod to customise this so I just need to spend a bit of time tweaking it I guess. Whether I will do or not depends whether I can be bothered between now and the end of August when my contract us up and I can upgrade to a new phone......