mondeo79 Posted April 15, 2005 Share Posted April 15, 2005 I am about to move web host and am concerned that I could end up having a period of downtime while DNS sorts itself out etc - at the moment I am on a shared server and my DNS is pointing to the hosts DNS servers which apparently complicates things somewhat! I was thinking of setting up the new server etc with a full build of OSC as it is on my site now etc on it and test it to make sure the paths etc work, then at a given time (say 3am where the impact will be least) close the site for an hour say and import the latest mysql dump so its set up and synchronised fully and then set up a forced redirect on the old server (which at this time will have still have the domain pointing to it) to the new servers IP address and path etc and then at same time change the DNS at my domain registrar to the new DNS server name so that while the DNS propogates surfers will get the redirect until the DNS is sorted at which time they will be going to the new server anyway - is this plausible? Has anyone done this and can they offer any advice on how to do it? Am I making this more complex than it needs to be? Is there an easier way of doing it?? TIA Jase Link to comment Share on other sites More sharing options...
Guest Posted April 15, 2005 Share Posted April 15, 2005 when i move sites, i take the site off line for about 5 minutes while i move it over. first, copy all the code to the new server and setup the configure.php files for the proper paths. down site #1 and dump the database. copy the database to site #2. in addition to adding the user to localhost, add the user so the database can be accessed externally (%). after you have done this, on site #1 change the 'localhost' setting in your configure.php files to point to the ip address of site #2. access site #1 to make sure the site is again working. if it is working with the ip address in place of local host, then at that time you can switch your dns without any loss of data/sales. if it does not work, go back to site #2 and find out why you can not connect externally from another site to your sql database. makes it much easier if moving from a cpanel system to a cpanel system, also if you have shell (SSH) access. i do this daily, makes it a piece of cake. Link to comment Share on other sites More sharing options...
mondeo79 Posted April 15, 2005 Author Share Posted April 15, 2005 when i move sites, i take the site off line for about 5 minutes while i move it over.first, copy all the code to the new server and setup the configure.php files for the proper paths. down site #1 and dump the database. copy the database to site #2. in addition to adding the user to localhost, add the user so the database can be accessed externally (%). after you have done this, on site #1 change the 'localhost' setting in your configure.php files to point to the ip address of site #2. access site #1 to make sure the site is again working. if it is working with the ip address in place of local host, then at that time you can switch your dns without any loss of data/sales. if it does not work, go back to site #2 and find out why you can not connect externally from another site to your sql database. makes it much easier if moving from a cpanel system to a cpanel system, also if you have shell (SSH) access. i do this daily, makes it a piece of cake. <{POST_SNAPBACK}> Hi John and thanks for replying, I do have CPanel and shell access on both systems - so basically what I need to do is change it so the database is on server 2 (the new server) so even if someone orders on the old or new server the transaction is recorded in the database on server 2? In doing this is all I need to do change: define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers to define('DB_SERVER', 'NEWSERVERIPADDRESS'); // eg, localhost - should not be empty for productive servers in configure.php in catalog/admin/includes and catalog/includes on the existing / old server? If so when the DNS finally propogates etc can I simply go into the new server and change the above back to localhost? Many Thanks Jase Link to comment Share on other sites More sharing options...
Guest Posted April 15, 2005 Share Posted April 15, 2005 you will need to setup a user with the same name on server2 which lets you access the database externally. since you have cpanel on both, then whomever you have hosting you can do this migration very easily via web host manager. i do this for my people all the time. this is the format from mysql command line on site 2 GRANT ALL PRIVILEGES ON dbname.* TO 'dbusername'@'%' IDENTIFIED BY 'dbpassword' with grant option; Link to comment Share on other sites More sharing options...
homewetbar Posted April 15, 2005 Share Posted April 15, 2005 Here is how I did my move, not the most elegant but it was easy and worked well. Installed the site down contrib. Installed everything on the new server using a backup of the database for temporary purposes. Set the new site to "site down" Started the DNS change 24 hours later the site was poping up for me as the new site so Set the old site to "site down" backed up and imported the database from the old server to the new server. Changed the new site to site back up. Left the old site as "site down" then nuked the old one a few weeks later. It worked great and no data loss... Most Valuable OsCommerce Contributions: Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294 FedEx Automated Labels -- Contribution 2244 RMA Returns system -- Contribution 1136 Sort Products By Dropdown -- Contribution 4312 Ultimate SEO URLs -- Contribution 2823 Credit Class & Gift Voucher -- Contribution 282 Cross-Sell -- Contribution 5347 Link to comment Share on other sites More sharing options...
Guest Posted April 15, 2005 Share Posted April 15, 2005 the purpose of doing it with the two sites together, is so you can keep the site going without losing any sales. not all dns servers propogate at the same time in the world, some can be instantaneous some can take 3 days. Link to comment Share on other sites More sharing options...
vincentjiang Posted April 20, 2005 Share Posted April 20, 2005 Why it is not good???? I checked them out...they host many sites... Link to comment Share on other sites More sharing options...
Guest Posted April 20, 2005 Share Posted April 20, 2005 per the etiquette here, no commercial items are discussed, and that is to protect everyone Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.