Wednesday, July 7, 2010

How I do upgrades

Sadly, I have not allocated the time to upgrade from F12 to F13. However, I attended the somewhat belated Toronto Fedora 13 Release Party hosted at the York University campus. Mostly this was a chance to catch up with some of the Toronto Fedora folks that I had met last year at FUDCon Toronto but I hadn't talked to in a while due an extremely busy personal life since the turn of the calendar.

I also got talking with Tom Fitzsimmons about version-to-version upgrades of Fedora. He does pre-upgrade every time because he likes his stable environment. Andrew Overholt had just done a DVD upgrade to his laptop. We got discussing the merits of keeping all of your existing install versus starting fresh with a clean wipe. I hadn't quite realized how novel my approach seemed to be, so I figured I would share.

On my main desktop, I have a 200 GB hard drive partitioned thusly: 200 MB for /boot, 2048 MB for swap, the rest is an LVM partition. In the LVM Volume Group, I've got a 20 GB LV for my root partition and a 40 GB LV for my home directory. Various other LV's are created usually for virtual machines.

When I want to install a new version of Fedora, I create a pair of new blank LV's for my root and home partitions. These are side-by-side with my existing active pair. I then download the DVD iso, burn it, and reboot into the installer. When I get to the storage section of the installer, I select manual partitioning. It automatically detects my existing LVM partition and lets me manipulate it. I let the installer obliterate my /boot (I find it is unhappy if I do not let it own /boot) and point it to format the blank LV's. From there, I proceed as normal with a fresh install. I really should figure out a better way to do the package list, but I typically pre-select most of the stuff I know I'm going to want. Once the install completes, I reboot. I now have a fresh install, and my old install is still available for reference purposes to grab configurations, customizations, and home directory preferences. I copy over everything I want to save from the old install, then leave it around dormant just in case I have forgotten something. If/when I get to the next upgrade without using the old install, I can reclaim the space for the upgrade. In a pinch, I can also rescue boot into the old install.

For me, I mostly end up with the best of both worlds. On the one hand, I get all the bells, whistles, and default configuration of a fresh install. On the other hand, I also get an easy migration path to get my old data onto my shiny new install. This is clearly a little bit more work than either pre-upgrade or a clean wipe, but I find it worthwhile.

Does anyone else use a similar procedure?

Sunday, May 23, 2010

Can we all agree that Spring isn't that lightweight?

Sorry Planet, this is merely tangentially Linuxy. I promise the next post will be more Linux & Fedora related, although that may not be for a few weeks.

So I've been working on a simple little Java web app as a learning tool for myself. The stack I'm using is Stripes 1.5.3 (a great little web framework that I'd like to package for Fedora), Spring 3.0.2, Hibernate 3.5.1 with Apache Derby in Tomcat 6. The reason I'm using this stack, rather than something like Glassfish or a JBoss 6 milestone, is for the express purpose to try out the new releases of Spring and Hibernate. The additional experience with the two frameworks is helpful as well. I'm actually using Hibernate as a JPA2 provider rather than native Hibernate.

Anyways, the refrain I've often heard about Spring is that it's "sooo much lighter weight than Java EE". Now, this was most assuredly true back in the dark days of EJB2 and J2EE 1.3/1.4. The world has since moved on to Java EE 6 which looks very spiffy and developer friendly with EJB 3.1, CDI and JPA. Back to Spring, from a developer's point of view, managing the 31 jars I needed just to get a single crud page working is a little involved and practically all of it came from Spring's dependencies. I needed 10 separate org.springframework jars plus their dependencies for a relatively trivial web application. The winner was of course the esoteric error messages explaining to me why it couldn't autowire something (missing configuration item for the transaction handling, which led to missing jar dependency to enable that feature). That Java EE App Server that bundles all the stuff I need? Yes please!

P.S. Yes, I know of Maven, but I wanted to keep the scope creep to a minimum for this project.