Assuming your frame has an 130mm OLD spacing because it was 7 speed originally - it may be reasonable to "stretch" the frame.
This requires a steel frame if your bike has aluminium or carbon fibre or titanium or wood or anything other than steel, this cannot be safely done.
The basic method is simple but brutal. You use leverage through the rear triangle and braced against the seat tube or a stringer that will protect the frame and spread the load. A 2-3 metre length of 4"x2" construction timber makes an adequate lever. Simply alternate sides of the frame until the OLD matches what you need for your 9 speed wheel.
Then you need to tweak the dropouts so they are still parallel. Skipping this means the wheel's nuts/QR won't sit square and will walk itself out of the dropouts over time.
Brakes should be unaffected by this stretching, and need no more tweaking than any other wheel swap. Pad alignment and closure gap is about all.
5mm is about the maximum a steel frame can be adjusted. That would be 126mm up to the next standard size of 130, or 130 to 135. You would not succeed in going 126-->135 because of excess stresses on the welds and brake bridge etc. I've personally done it on a steel MTB and the resulting bike went from 3x5 speed to 3x9 speed, and I still ride it 8 years later.
The front fork will almost always be 100mm OLD, and should not need modification at all.