PDA

View Full Version : Moving sites to new Hosts help!


donm1021
Mon., Feb. 20, 2006, 10:36 am
I was wondering if anyone here has experience moving entire sites and MySQL databases to new hosts?

I am having a problem where my current host does not have a cpanel nor an option to back up my site in order for moving purposes.

Does anyone know of how I can accomplish this move and keep my permissions and everything else intact including my MySQL database?

David Gillaspey
Mon., Feb. 20, 2006, 11:39 am
Hi,

Thanks for posting.

I've moved my site (Great Church Websites, which hosts this forum) three times in two years of operation.

As for moving the actual HTML (or PHP etc.) files, they're stored on my home computer anyway, so I uploaded them to each new host's server from my computer via ftp, each time I had to switch hosts. That's relatively painless, although because I have many images (the screen shots for the church home pages in my database of well-designed church websites), I often ran into a server time-out issue. That is resolved by ensuring I only uploaded so many images at once to an Art folder.

I recall having an ftp program at one point that could directly copy files from one host server to another, however.

As for the mySQL database(s), does your current hoster provide the phpMyAdmin interface to mySQL? phpMyAdmin will enable you to dump the contents of the mySQL database to a text file for upload to a new site. The file includes the necessary commands to re-create and re-populate the database and all tables on the new hoster's server.

(When dumping the contents of the mySQL database using phpMyAdmin, you will see a number of options. These are unfortunately rather confusing.)

(If your current host doesn't offer phpMyAdmin, it still be possible to write code, including SQL commands, that does the same thing.)

Watch out for this "gotcha": I think it would be safe to say that most hosters install the mySQL server on a server called or designated as "localhost". However, one of three web hosting companies I've used required a different path to the mySQL server. You'll want to inquire what the path to the mySQL server will be at the new web hosting company. If it's "localhost" then when you've duplicated your web pages and re-created the mySQL database(s) (using the data dump and re-upload scheme mentioned above), you should be good to go. Otherwise, you'll have to tweak code a bit to reflect the new path to the mySQL server.

Once you've establish an account at your new hoster, you'll want to send the new hoster's DNS (domain name server) info to your domain name registrar. It takes up to three days or so for this info to be dispersed through all the backend databases that make the internet work, however. Thus for two or three days, you can't be sure whether a visitor to your site will see files located on the old hosting company's server or the new hosting company's server. This shouldn't be too much of a problem with the HTML files, but could be a serious issue if your mySQL database is constantly being updated as users access it. (This depends on what you use the mySQL database for.) I say this because for a period of several days, new updates to the mySQL database might go to the copy on the old hosting company's server, or might go to the copy of the database on the new hosting company's server. Thus the two copies will become out of sync, and it will be difficult to sync them again.

Sincerely,

David Gillaspey
President
Great Church Websites