Well...fear no more, as you can easily restore the SMS database into your new unit, starting from the backup of the old unit. Read on for the how-to...
First, disable the option Automatically sync when this iPhone is connected in iTunes before starting this procedure (assuming it's enabled in the Summary tab of your iPhone). Then follow these steps:
- Navigate to the folder ~/Libary » Applications Support » MobileSync » Backup.
- In the folder found above, there will be n subfolders containing your n iPhone backup sets (those iTunes makes when you connect your iPhone to your computer). In my case, I had two subfolders, one for the 3G and the other for the 3GS. The name of each folder will be a string of 40 randomish hex characters.
- Sort the view by date--this will let you easily tell which subfolder belongs to which phone; enter the one that belongs to the phone that contains your SMS history (or the source iPhone, if you like). The other will be named destination iPhone.
- Option-drag this latter folder to the desktop for safety, in case something goes south along the journey.
- Copy these two files...
3d0d7e5fb2ce288813306e4d4636395e047a3d28.mddata
3d0d7e5fb2ce288813306e4d4636395e047a3d28.mdinfo
...from the source iPhone backup folder to the destination iPhone backup folder. The Finder will warn you about overwriting the existing files; just do it. - Connect your destination iPhone to the computer and fire up iTunes (since it shouldn't have started by itself if you followed the initial note).
- When your iPhone appears under Devices in your iTunes sidebar, Control-click it and select the 'Restore from Backup...' option.
- Select the backup related to your device (i.e. the backup of the destination iPhone that you just 'patched' with the two files coming from the source iPhone).
- Have a cup of coffee and let the magic happen!

