2 speed pump speed change

So I am changing a single speed pump to a 2 speed setup with a manual switch. Is it ok to change from low to high and high to low speeds while the pump is on? Or should I turn off the pump, let it come to a stop, and then change the speed switch and then turn the pump back on again?

The pump is turned off between speeds. Most pumps will come with a “center off” style switch which will turn the pump off when switching speeds.