The way you have 2 setups sharing DB and moodledata would also make Linux confused.
My guess is moodledata is very large and that's why both instances are using same moodledata (a no-no). Only way to avoid issues, 2 separate/unique FQDN's.
The only way to keep old site accessible with no issues in production site is to separate completely ... each has own code, own moodledata and own DB. DNS comes into play.
If my guess was correct, attach a drive to the server with enough room to old the data directory for the old moodle site. Plus use a different DB for each.
'spirit of sharing', Ken