[CRITICAL] ClearDB database size is near quota limit

by Shijaz Abdulla on 30.03.2013 at 00:10

My WordPress site is hosted on Windows Azure and uses a MySQL database that was set up automatically on ClearDB.

For the past couple of days I have been getting warning emails from ClearDB, the provider of MySQL databases for Windows Azure customers that my database quota is almost full.

Database: mydatabasename
Tier/Plan: Mercury
Tier size quota: 20 MB
Current database storage allocated: 98.28% (1.72% remaining)

Please note that the use of temporary tables as well as index sizes are included in our storage size calculations.

We suggest that you consider upgrading your database to the next service plan to ensure that it does not exceed our storage quota policy. Databases that exceed our service plan storage quotas are automatically locked to ensure the highest quality of service for all of our valued customers, and we don’t want you to experience an interruption of service.

If you’re getting these messages and you’re using the database to run a WordPress site, make sure you compact your database before going to pay for the next higher tier/plan on ClearDB. Chances are that you might not have to upgrade after all!

I simply used an Optimize Database wordpress plugin and it reduced the database size by 50% by removing revisions, trashed items, spammed items etc. Now I can continue using the free ClearDB database without incurring any additional costs.

Migrating a blog from Blogger to WordPress

by Shijaz Abdulla on 30.12.2009 at 11:56

 I have finally moved my blog from Blogger (Blogspot) to WordPress with zero downtime and zero search engine reputation loss (pagerank). I thought I’d share the process I followed here.

Here are the main steps involved in Blogger-to-Wordpress migration:

  1. Setting up WordPress
  2. Setting Permalinks structure in WordPress
  3. Preparing your Blogger blog for export
  4. Importing posts & comments from Blogger
  5. Fixing your permalinks
  6. Using Windows Live Writer with WordPress

image
In my case the domain name is not changing, only the blogging platform is. Depending on your scenario, you might need to purchase a domain and/or hosting. If you need help, post a comment to this post.

Part One: Setting up WordPress

There are two kinds of WordPress blogs you could have – WordPress.com or WordPress.org. WordPress.com is the free, hosted blog solution, while WordPress.org lets you download the WordPress software for your own hosting/server. The second option is recommended because it gives you FTP access to your server, and this is required in step 5.

I took Deluxe WordPress Hosting from GoDaddy, and it came with WordPress pre-installed, with tons of themes and plug-ins to choose from.

In order to prevent downtime during the migration, you should configure a CNAME on your existing blog’s domain and associate it with the WordPress blog. For example, if your blog is at microsoftnow.com, make the WordPress blog at temp.microsoftnow.com. This way visitors to your Blogspot blog will not be affected till you are done with the migration.

Also make sure you set the domain/blog URL to temp.microsoftnow.com in the WordPress admin page.

Once you’ve acquired your WordPress hosting, you have to create an empty blog on it with the same name as your blog. This will be the blog to which you will import your posts to.

You will also have to find an identical theme for your WordPress blog and apply it.

 

Part Two: Setting Permalinks structure in WordPress

This is important so that your permalinks remain intact when you import from Blogger. On your WordPress dashboard, go to Settings > Permalinks.

Choose custom structure, and enter /%year%/%monthnum%/%postname%.html

Hit the Save Changes button.

image

Part Three: Preparing your Blogger blog for export

It’s important to understand that when WordPress imports posts from Blogger, it uses your Blogger blog’s feed. Hence, you will have to remove any headers/footers from your feed so that these wont show up in your posts on WordPress.

To check and remove if you have any feed footers, go to Dashboard > Settings > Site Feed, and clear the Post Feed Footer field:

image

Part Four: Importing Posts & Comments from Blogger

  • On the WordPress admin console, go to Tools > Import

image

  • Choose Blogger

image

Click Authorize. You will be asked to login to your Google account and grant access to WordPress so that it can pull content from Blogger. Click Grant Access.

image

On the next screen, you will be presented with a list of blogs on your Blogger account. Click Import next to the blog that you wish to import.

The import process will begin:

image

You will see the import progress above. In case the import process stops halfway, hit the Continue button to continue importing. Even if you repeat the import process altogether, WordPress will ignore the posts it has already imported and there will be no duplicates.

Another important point to note: The DNS setting for the old blog should not be changed till the import process has completed. If you changed the DNS setting for the old blog before import, the import process will fail with the error “Nothing has imported. Had you already imported this blog?

Once all posts and comments have imported, verify it by browsing them on your WordPress blog.
PerformancingAds

 

Part Five: Fixing your permalinks

Even though I set my Permalinks in WordPress in Part Two, this was not 100% compliant with Blogger permalinks. Blogger has a way of shortening your blog’s title in the permalink, while WordPress just puts the whole title in the permalink.

This is where I found an ingenious workaround from Rahul Bansal’s blog. He has written this awesome PHP file, that converts the Permalinks on all your imported posts so that it will be identical to that of Blogger. I am reproducing his code here for your convenience:

<?php require_once(‘wp-load.php’);

$res = $wpdb->get_results(“SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = ‘blogger_permalink'”); $wpdb->print_error();

foreach ($res as $row){

$slug = explode(“/”,$row->meta_value);

$slug = explode(“.”,$slug[3]);

$wpdb->query(“UPDATE $wpdb->posts SET post_name ='” . $slug[0] . “‘ WHERE ID = $row->post_id”); $wpdb->print_error(); }

echo “DONE”;

?>

All you need to do is paste this code in a new file, and call it FIX.PHP. Upload this file on your WordPress hosting, and execute it from your browser – http://blog.mydomain.com/fix.php . You will receive a confirmation “DONE” if all is well. If not, try contacting Rahul.

Now you can finally change the DNS settings on your domain so that your new WordPress blog will be active.

Part Six: Using Windows Live Writer with WordPress

Before you can use Windows Live Writer with WordPress, you need to enable XML-RPC.

On the WordPress dashboard, go to Settings > Writing. Enable the checkbox next to XML-RPC.

image

Notes/Things to Remember:

  • Do not delete your Blogger blog. Your images are still on Picasa, which is used by Blogger to upload images in your posts. Your WordPress blog still pulls those images off Picasa. As of today, I have found no reliable method to migrate images across.
  • If you have an Outbrain widget for Ratings, you just have to install the WordPress widget. As long as your blog’s URL has not changed, your ratings will remain. If your blog’s URL has changed, you need to contact Outbrain support and they will manually merge your ratings for you.