Be aware that there is likely a groove worn into the cable housing by the old wire. If the new wire is a different diameter it may or may not move smoothly through the old housing. Even though it is extra work I generally replace both the inner wire and the housing together. Try the new wire first, if it works OK you are done. If you have slow or hesitant shifts, especially to smaller chainwheels you may be forced to replace the housing.
While you have the ferrule off of the housing, inspect the housing end to be certain that it has been cut or filed flat and does not have any loose strands protruding. Correct if necessary before reinstalling the ferrule.