Doraemon's history was constantly retconned and has differed in various iterations, but several aspects remained consistent.
Doraemon was manufactured Matsushiba Robot Factory on 2112, bearing the code MS-903. He was damaged by an electrical bolt during production which detached a critical screw from him, degrading his abilities in general while crippling a variety of external attachments. As with his peers purposed as mechanical child caretakers resembling cats, he also underwent training, though his performance is generally subpar and he is often regarded as an outmode. Sometime before he entered service, he was infatuated with another mechanical cat.
After he left production, Doraemon was adopted by an infant Sewashi Nobi, who he quickly bonds with. Being designed after a cat, he was not musophobic. However, his ears were later damaged by rats, much to his terror, and eventually a failed surgery left him bald. Noramyako, who happened to visit him, laughs uncontrollably at his bald head, and their relationship sours. He is unable to obtain any replacements due to Sewashi's low income. Soon, he loses his bodywork in his depression and is left with the blue base paint, resulting in the manufacture of his sister model Dorami.
As per the request of an adult Sewashi, Doraemon is later dispatched into the past and stays to help Sewashi's great-great grandfather Nobita in an attempt to alter the horrendous future of the Nobi family, setting the entire series' events into action.