iPhoto problem after upgrading to Mountain Lion I had an iMac running Snow Leopard. When I upgraded to Lion, iPhoto didn't recognize the photo database and I spent a year organizing it again. The error message I received was something like: "iPhoto didn't recognize your backup".

I want to install Mountain Lion, but I am concerned that I will encounter the same problem again. What can I do to be sure everything will be work fine after installing Mountain Lion?
Firstly, make a backup of the library.  At least you will have that in-case anything does go wrong.  

Then make sure you update iPhoto to the latest version before you upgrade the Operating System.  

Finally, repair your Disk Permissions using Disk Utility http://support.apple.com/kb/PH5821

I've updated many times and never had iPhoto be affected by an OS upgrade.  Thats not to say it isn't possible.  The above steps will put you in the best shape to move forward.

If you upgrade and have an issue with the iPhoto database, hold down Command and Option keys whilst starting iPhoto to get a list of rebuild/recovery options.

Hope that helps.