Is there a way to preserve app icon categories (folders) in iOS when factory resetting an iPhone?
I found this, and it works:

Say you restore your iPhone with a full wipe and restore. Then you choose a previous backup to restore all of your settings and applications. When your iPhone is done restoring to your backup, all your icons are mixed up on the SpringBoard.... what the heck? You want to get them back don't you? Well, I know a trick and I don't think it's documented anywhere. Here it goes.

**Important: Before starting these instructions, backup your iPhone. Then go into iTunes preferences and turn on "Disable automatic syncing for iPhones and iPods" This way your backup won't get overwritten after your iPhone gets restored.


Restore your iPhone and let it restart and activate.
Then iTunes will happily ask you if you want to restore from a previous backup (with all of your settings and Applications). Click the backup you want to restore to and let it restore and reboot.


(Here's where things get messed up. Your iPhone backup actually restored the correct icon positions except none of your apps were installed before the restore was complete, so iTunes has to copy all of your apps back to your iPhone. When it does this, it copys them in alphabetical order, thus messing up the location of all your 3rd party icons). Here's how to fix this without memorizing where all your icons went.


Right click (or Control-click) on the iPhone icon in iTunes and choose "Restore from Backup" and choose the backup you chose in step 2 again.
Let your iPhone restore for a second time and when it reboots, all of your icons will be in their original places. (This is because iTunes didn't have to install the Apps because they were already there, thus keeping them in their original locations according to the backup).
Return your iTunes preferences and uncheck "Disable automatic syncing for iPhone and iPod"