I copied this from a solution given in Yahoo answers:

go to

C:\Program Files
\Yahoo!
\messenger
\Profiles
\youryahooprofilename
\Archive
\Messages

and move these files to a different folder. (i.e. C:\saved-msgs)
Then if you re-install YIM, just move (or copy) them back,

However I've yet to be able to read the archives without using the 'message archive' feature on yahoo instant messenger.