rotating a mesh with armature


blender has z as up axis but the game engine i use has y as up axis, so I would like to rotate my character before importing into the game. 

the problem is when i rotate the armature and the character by 90 degrees, the animation goes crazy, can somebody give me a safe step by step on how to rotate a rigged character by 90 degrees.