"Whats the back story?" I don't get how people can't understand what is happening here.
Let me break it down.
Prime is the leader. They prepare for the journey of the Ark, as a precaution to potential decepticon disaster, Xaaron had a copy of Prime's mind and personality stored into a crystal (kinda similar to Prime being stored on the floppy disk in the comics)
We all know about the decepticon attack on the Ark and the resulting millions of years in which they laid dormant. In the mean time, The autobots still on Cybertron were likely hurting (and losing lots of battles) without their leader. Xaaron decides to build a prime like body with the intent of passing who would become magnus off as prime himself. Had the cons not attacked the storage facility where the crystal was held and partially destroying it, the new bot would have been optimus prime (which could have ultimately led to so many stories including Nemisis prime) Ultimately, Xaaron built Ultra Magnus to resemble Prime with the hopes of him being the new symbol of the autobots on cybertron, the new leader who only leads because he has too.
In a nutshell, it was to fill in the leadership gap while prime was on earth without cybertronian contact for an unknown millions of years.