My toilet in a small 5er went from the toilet flange through a 45 degree fitting, about 18 inches though another 45 degree fitting (to turn the pipe to straight down again, into the tank. I wanted to move the toilet a couple of inches to get more room in the shower/toilet room. I cut the 18 inch section near the two 45 degree fittings, moved the toilet flange back the 2 or so inches I wanted to move it (making sure the trim covered the hole that was now there). Used two rubber no-hub fittings to tie in the pipe where it had been cut. Worked great.
You need to follow your drain, and see if/where you can cut and reconnect. No-hub fittings make a great way to connect pieces that are not perfectly aligned.
Regards,
Doug