Two identical web sites with two identical mySQL databases that function indepently


#1

I’m trying to have two identical web sites with two identical mySQL databases that function independently of each other so I can work on an upgrade on one. I set up a subdomain on a VPS server that I am trying to do a moodle site upgrade on. I copied all the original files over to the VPS server and am now going to do software upgrades. I’m confused on how I won’t mess up mySQL databases and still have them function on the original site if I upgrade the moodle on the subdomain VPS server (I assume the moodle install files I copied “know” it’s linked to the old mySQL database??? If I do something that alters the database (like upgrading the moodle version) on the subdomain VPS wouldn’t it be linked to the original website so I would assume will alter the database for both sites and thus break my functioning old site that won’t have the updated moodle version? How can I avoid this? How can I make them be copies yet function independently? How can I create a copy of the mySQL database and link it to my subdomain VPS “play area” where I have the freedom to potentially mess it up and still have the original domain on the other server running fine with the older database? I know I am most likely asking this very poorly as I only know how to do what I do by fumbling around and have very little training in this. Thanks for any advice.


#2

I sort of figured this out. I’m going to create a new database for the VPS and import the existing database into it using phpadmin. I then assume I will have two independently functioning databases. One that I can use as a test. I can then link the new database copy to the VPS server by simply telling moodles config.php file where it’s located.