New motor only rotates clockwise
Looks like the blue and yellow wires are going to the motor and the other wires are an encoder? 5K pot for position sensing? Looks like that was used as limited rotation servo. Component on the back of the motor looks like a filter capacitor to try to keep commutator noise out of the control circuit. Use a full Bridge motor driver to control the motor on the blue and yellow wires. Red wire to the Arduino Vcc and black to GND, white to an analog input. Make sure you don't drive that pot too far, 270 degrees or so is all it's likely to take before it breaks. You'll probably need to rewrite some code to make that work if you were using a stepper previously and just counting the steps in open loop mode to track the position. With this new setup, you'll need to run closed loop to prevent driving the servo mechanism too far.