How can I back up apps which are no longer available? I have an old iPhone 3G I'd like to repurpose.  I've got some apps on it which work fine, but the current versions in the App Store won't run on a device this old.  How can I back up the phone and the apps on it in such a way that I can restore and continue using those apps?
I eventually figured out a solution.  iTunes has an option to back up apps from the phone, which is called "Transfer Purchases".  It moves around in every version of iTunes, but it should be there.  Because I was using an iTunes installation associated with a newer iPhone as well, I had newer, incompatible versions of apps already downloaded, so transferring would not overwrite them with an older version.

In order to transfer the apps, I created a new user account on my mac, authorized it with my apple id, and then I was able to transfer purchases off the iPhone 3G to this new account.  To be safe, I then copied the files out of the iTunes Media folder, just to ensure that I won't accidentally do something in iTunes to destroy these files.