When harvesting d.c. motors from drills, printers, and other sources, I like to start with a clean slate and that entails removing the press fit ends of the shafts which usually have a pinion gear or belt drive spline. Pulling them off without damaging the bearings, shaft, mounting screws etc. is made easy by using a piece of scrap square tube as a custom sized gear puller.
Step 1: Drill and Tap
At an appropriate distance from the tube end, I drilled a centered and square through hole for a 3mm tap size, flipping the work I then counter- drilled a larger clearance hole for a 4mm rod on what was to become the bottom of the tool. I then hacksawed the land material away so only a parallel slot was left. I finished the tool by tapping the smaller upper hole for 3mm threads, this being a good size to push against the 4mm motor shaft end.
Step 2: Turn It Off
Liberating it was as simple as sliding the motor into the slot and turning the press screw down on the shaft end until the pinion was freed, really quite simple and easy to do and, if I had an occasion to, I could easily press fit the part back on with no harm done.