WordPress Migration a Few Lessons Learned
Having started this site on the HostGator shared service then moving it to their reseller service and then onwards to the reseller service of Smackhunt, there was one thing I forgot to do.
It was a crucial oversight and one that no one really told me I should do before I make the move.
Always look before you leap!
Or in the case of a WordPress site, look at the condition of your database and directories before you leap.
Having had one site acting very strangely over the weekend, I finally pinned most of its madness down to legacy issues with its database.
I created several opt-in pages, the site ‘lost’ these, so I created new ones and just to rub salt in the wounds, the site remembered enough about the originals to stop the new ones from being published!
This insanity was repeated for several pages and sites over the entire weekend, needless to say I did have a drink this weekend.
So how should you care for your WordPress database to prevent the early onset of WP dementia!
Well I found a great post by Matthew Horne that illustrates just how to begin cleaning and maintaining the health of your database and its memory.
As this database is the heart of your site, I would recommend treading lightly and not going in all gung ho with a scythe!
Follow the instructions of Matthew and you will be fine, he rightly focuses on the post table because that for us is where most of the action occurs.
One thing I would add to his guidance is to take to inspect the URLs in the post database table.
I found several posts and pages (these are classed as the same thing in your database) that although present on a live site had URLs from my development site. Thankfully this was an easy fix using the query below but still no idea how these managed to migrate to a totally different site.
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com', 'http://www.new-domain.com');
The above code has been spread over several lines for clarity
Going forwards I am going to explore the possibilities of minimizing the number of plugins I have on my sites because I have realized that each WP site is like a game of Jenga.
The health of your database which alongside the core WP software is the foundation that your combination of plugins rests upon. This means that as you update the foundation or move plugins above, each of your sites will respond uniquely to this manipulation which as I found out sometimes results in the tower falling over!
Like this post? Subscribe to my RSS feed and get loads more!