1998 Subaru Forester 234,000 miles

I drive a 1998 Subaru Forester with 234,000 miles on it. When I accelerate, the shifter moves. Can you tell me why? There is also a scraping noise being made (off and on) when I drive. The faster I drive the worse the noise. At freeways speeds the noise changes from a scraping sound to a high pitch squeal.

First thing I’d check is motor/transmission mounts.

You might consider checking the transaxle gear oil level; and I’m assuming this is a manual transaxle. Scraping and squealing could point to a ring/pinion gear about to disentegrate due to lack of oil.
This can also cause the shifter to buck and jerk due to a binding ring gear.

If the gear oil is fine then you should consider the possibility of a broken transaxle mount or broken pitching stopper. (the latter is essentially a top mount)