Recovering from a database crash

Well, I just recovered from a bit of a freak-out.

One of my web hosts’ databases crashed so a number of the WordPress sites I managed were coming up with “Database connection error.”  The web host techs were quick to fix the database so the sites would come back up, but on one of the sites, all the posts were gone.

My first thought was to restore from a backup. I use WP Database Manager by … so I thought it would be an easy fix… until I saw the most recent backup was from March – 3 months ago.

And my freakout entered into stage two.

After I remembered to breathe, I thought maybe there is an error in WordPress that is misreporting the number of posts.  So I logged in to the MySQL admin and found a message saying several of the tables were in need of repair due to a server crash.

So I ran the repair function in the WP Database Manager plugin (I could have used the MySQL admin’s) and all the posts returned!

I checked the backup settings in WP Database Manager next and just resaved the settings.  It started working again.

So the moral of the story is don’t freak out when all you posts turn up missing.  Check the database for errors.

And make sure your backup is working.

An error occured while updating a plug-in

I tried to update my plug-ins and one or more of the plug-ins gave me an error that looks like this:
An error occurred while updating <plug-in name>: Could not create directory. <full-real-path-of-folder>.

Then I went the plug-in page and it says those plug-ins have been deactivated because they are not found.

Then I tried to reinstall those plug-ins, but that gave me an error.

Then I tried to upload the plug-ins using an FTP client, but I got  a “550 Access denied” error.

I logged into my Godaddy Windows shared hosting account.  When I tried to access those folders, I got another “Access denied” error.

To fix it, I went to the parent directory “wp-content/plugins” and reset its permissions.  I unchecked “inherit”, then checked “read”, “write” and “Reset all children to inherit” then clicked OK and waited for the operation to complete.  I looked in the plugins folder and found the problem folders were no longer there, but I could reinstall them successfully.

I wish I could remember where I heard how to fix this, because I would like to credit where it’s due.

On a another blog I maintain, I thought I could prevent the install error by resetting the folder permissions before updating.  Nope, didn’t work. The plugin folder did not have “inherit” checked, but did have “read” and “write” checked.  I checked “Reset all children to inherit” and click OK as before.  So I tried again, but this time click “inherit” for the “plugins” folder and checked the “Reset all children…” box, and it worked that time.

So it looks like if the “inherit” box is checked, you need to uncheck it and vice-versa.  Just as long as read and write permissions are getting set for the child folders.

The same plug-ins that gave error when updating on the first blog gave me an error on this blog.  Some plug-ins updated fine.  So I don’t know if the problem is with the server, the plug-ins, or a combination of both.

Anyone else having this problem on a Godaddy Windows server?

Cloudflare

I just learned about Cloudflare.com today.

From their overview page:

CloudFlare protects and accelerates any website online. Once your website is a part of the CloudFlare community, its web traffic is routed through our intelligent global network. We automatically optimize the delivery of your web pages so your visitors get the fastest page load times and best performance. We also block threats and limit abusive bots and crawlers from wasting your bandwidth and server resources. The result: CloudFlare-powered websites see a significant improvement in performance and a decrease in spam and other attacks.

I just set them up for this site under the free plan and plan to set up more.  The set up was fairly easy if you are used to changing DNS settings for your domain.

What are your experiences with Cloudflare?

Domain changed!

So I changed the domain to WPressureCooker.com.

I thought I’d share how I did it to show how to do it so you don’t have to worry about folks trying to get to your site through the old domain and getting a 404/”file not found” message.

The first thing I did was some research to find the best way to do this.

Quick disclaimer: This may not be the best way for your site.  But this worked for me.  Be sure to back up your database and files before proceeding.

I followed the Yoast.com site’s advice and created a robots.txt file, but ended there because I was not moving any files and he was giving instructions for an Apache server where I was using a Windows server hosting plan.

In my Godaddy hosting account, I set the new domain (wpressurecooker.com) to point to the same folder wordpressurecooker.com is pointing to, and waited for the status to go from Pending to Setup.

Logged in my site’s admin and went to the General settings.  There I changed the Blog URL and Site URL to the new domain name.

I installed the plugin, Domain-Change by Soz which creates the 301 Redirect for you that automatically redirects folks from your old domain to the new.  So if someone comes to your site by a link that goes to a specific article, the page comes up under the new domain.  Even my shortened Pretty Links worked.

I deleted the robots.txt file from my site.

Next came the stat tracking.  I use Google Analytics.  I was hoping that the 301 redirect will take care of most of the problems, but just in case, I made a change to my Google Analytics account and the Google Analytics for WordPress by Joost de Valk settings.  There is the possibility I did this wrong, but in Google Analytics for wordpressurecooker.com I set it to track “multiple top level domains”.  I noticed the code (that you would paste in if you didn’t use the plugin) changed where _gaq.push([‘_setDomainName’, ‘none’]); so in the plugin settings, I set Domain Tracking (which sets _setDomainName) to “none”.

I also have WordPressurecooker.com registered under Google’s Webmaster Tools.  That required me to verify the wpressurecooker.com domain, then for wordpressurecooker.com, I clicked “Change of address” under “Site configuration” I set the New URL for wordpressurecooker.com to wpressurecooker.com.  In the settings for wpressurecooker.com I set the sitemap URL.

It took me a lot longer to type this all out than to make the changes, so I think you will find it pretty easy.

So did I miss anything?