A new home for an old site
There are two ways of moving a WordPress site from one server to another.
One is to create a database, and then copy all files to the new server, point wp-config at the new database and copy the contents of the database across. This is the simplest way and ideal if, for example you are switching hosts.
The other method is trickier, but a lot more efficient, creating a leaner and faster site. I have just completed a transfer of Head Rambles using this method.
The first thing is to create a new blank database on the new server, using a spare domain name for access. Then upload a fresh copy of WordPress and using its built in features, create a new WordPress site. The new site should be set up with the same Title and Subtitle as the old site, but using the new domain.
Next, copy across the theme files from the old server. In my case I did a fresh install of Weaver II and then copied over the little backup files. Any specific image files [such as the Banner and any images in the sidebar] should be copied across also.
At this point the new site should look identical to the old, but contain no posts or pages.
In my case, I then backed up the old database but did it one table at a time. I then imported into the new database the following tables – Posts, Postmeta, Comments, Commentmeta, Terms, Term_relationships, Term_taxonomy and Links. If the new database has been set up with a different prefix from the old [for example, if the old was WP_ and the new one is NEW_] then before uploading the files to the database, open them in a text editor and do a simple search and replace.
Don’t forget to copy over a copy of wp-content/uploads.
Now is the time to transfer plugins. The ideal is to upload fresh copies of each plugin to the new site. This is the time to decide which plugins are really necessary and which ones can be dumped. Be ruthless!
At this point the site should be running smoothly and be identical in all respects to the old, apart from the domain name. Now is the time to test that all the plugins are functioning correctly and that the site is behaving itself.
The next part is the tricky part.
Shut down the old site for changes [for example, disable comments]. Take another backup of the Comments database tables [and Posts if that has changed]. Upload these to the new database.
Now point the domain to the new server. While that is propagating, open up the Options table in the new database and change every instance of the temporary domain to the permanent domain.
Once the domain has switched and is pointing at the new server the job is complete. You should now have a much leaner faster site.
In the case of Head Rambles, the database dropped in size from 54Mb to 32Mb and from 34 to 17 tables. Average page load time dropped from 1.48 seconds to 0.66 seconds which is quite impressive? The main losses were database entries from redundant plugins and trimming the Options table from 16,225 records to 276 [a saving of 4.7Mb!].
The only problem I had was in switching the domain, where a couple of DNS servers got locked up for some reason. It meant the whole domain was dead for a while, but the wait and the trouble was worth it.
To be safe, I have kept the old site running but with a different domain name. It is blanked out for the general public but I can access it, for example if I need to cross check settings or retrieve any logs. Once I am happy that it is redundant it, and its bloated database can be scrapped.
Comments
A new home for an old site — No Comments
HTML tags allowed in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>