WordPress plugins, themes, tips and hacks

6 things to remember when moving WordPress blogs to a different host

Tuesday, July 8th, 2008

I recently had to move all my WordPress sites and blogs to a new server because Bluehost sucks. My sites were going down on a near-daily basis for way too long, and they couldn’t care less. So I did what I really did not want to do, and moved six WordPress sites to a new hosting provider, which has proven itself with my clients’ sites: Hostgator. And along the way I’ve learned quite a few things about what to pay attention to when moving WordPress sites from one place to another, which I’d like to share.

Lesson 1: WordPress’ native XML export is not good enough

In WordPress, you can easily export a site by going to Manage > Export, which will create a unique XML file that you can import in any new site. This is fine for a very simple, single-user blog without heavy customizations. However, if your blog has multiple users, and if you have added info to their profiles, that info will be lost in this export. In addition, all users will be given a permission level of Subscriber, which is annoying if you need to go and change everyone back to their original permission level.

Also, if you have installed plugins that created new tables in your database, these will not be exported.

And, if you had any links saved, this will not save your links. See Lesson 6 below for more information on this, but the point is that the only way to save your links AND their categories is to export your entire database.

Therefore, in order to retain all settings and information that your site needs, the only way to do so is to export your entire database, and then import it to the new WordPress installation.

Exporting and Importing a WordPress blog

Here’s how you export and import your WordPress database. WARNING: Messing with databases in PHPMyAdmin can be hazardous to your health and to the health of your site. One wrong move and everything will be but a distant memory. So make sure to backup like crazy; and I take no responsibility for any harm you may come to by following my instructions. Now, let us begin:

  1. Log in to PHPMyAdmin via your control panel or however else you log in.
  2. If you have multiple WordPress blogs on one server, you may see a list of databases in the left-hand sidebar. Make sure you are dealing with the right database. The way that I check which database is the right one is by browsing the database and viewing the information there, whether it’s posts or even meta data like the blog name. To browse, click on the browse icon next to a table’s name (Note: your PHPMyAdmin interface may look a bit different, depending on the version you are using):
    Browse database tables in PHPMyAdmin
  3. Once you are sure you are in the right database, click on Export at the top of the PHPMyAdmin toolbar:
    Export database in PHPMyAdmin
  4. On the Export screen, I usually leave all the settings as is, but I do make sure to to 2 exports: a compressed (gzip) export, and a regular export, just in case. So export one while selecting None, as shown below, and one while selecting gzipped:
    Compress export file in PHPMyAdmin
  5. Now on to importing: install WordPress on your new server.
  6. Go in to PHPMyAdmin for your new server, and delete all your tables for your new WordPress installation (Yikes!). In PHPMyAdmin, to delete is called to “drop.” So on your main database page, select all your tables and click on Drop, or on the red Xs next to the table names:
    Drop tables in PHPMyAdmin
  7. Now, import your exported WordPress database into your new installation. To do that, stay in PHPMyAdmin for your new site, and click on the Import tab that is to the right of the Export tab on the toolbar (see image in step 3 above).
  8. Browse to find your exported database file. Leave the rest of the settings, and click Go.
  9. Now your old WordPress database is in your new installation. It may work at this point, so go check. If it does, great. If not, continue reading.
  10. You need to make sure that your database table names work with the new installation of WordPress. This means the following: if you installed your old database with Fantastico, all your database tables have a prefix of wp_. If you didn’t install it with Fantastico, the database tables probably don’t have a prefix. Your new database tables may have a different naming convention depending on how you installed it. So, take a look at your database table names, and note if they start with wp_ or not. Now it is time to open wp-config.php.
  11. Once you have opened wp-config.php, look at line 16, which says something like this:
    $table_prefix = ‘wp_’;
    If your database tables start with the wp_ prefix, leave the line as above. If they don’t have a prefix, change it to:
  12. $table_prefix = ”;

Now your blog should mostly work (I hope)! But there are a few more things that we need to take care of:

Lesson 2: Widgets are not preserved with an XML backup, even with a full database backup

If you are using widgets somewhere in your blog, you will have to redo them one by one on your new blog if you use the XML backup. So take out a pencil and paper, and write down exactly what widgets you are using, what order they’re in, and any modifications or customizations that you made to them. Ok, you can use Word or Notepad if you want, but that’s about as technologically friendly as you can get.

Lesson 3: In addition to backing up your theme and plugins folder, remember your Uploads folder!

In your blog under Settings > Miscellaneous, you have set where any uploaded files or images will be stored. Make sure to backup that folder, in addition to your theme and plugins folder, so that you will have all those files in your new blog. In your new blog, go to Settings > Miscellaneous and make sure it’s pointing to that re-uploaded Uploads folder.

Lesson 4: Make a note of your site’s permalink structure

You want to retain the same permalink structure for your new site so that you can continue to enjoy the same traffic you had before from search engines and incoming links. So make note of your permalink structure, and once your new blog is installed, make sure to go to Settings > Permalinks, and set the same structure there.

Lesson 5: Don’t forget your favicon

Your favicon can get lost in the shuffle. Make sure to back it up, and upload it to your new site.

Lesson 6: It is hard to preserve WordPress blogroll links and their categories

Here at WordPress Garage, I had a page until recently called “Links we Love.” I had painstakingly added, categorized and described many links that I thought were useful to my readers. Well, during the whole server move, the links got lost because we didn’t export them by going to http://wordpressgarage.com/wp-links-opml.php, and saving that OPML file as a text file for importing later. In any case, even if I had saved that and imported it here, I would have lost all my categories anyway. So just note that if you’re depending on the XML backup, you will lose all your links. If you back up your links with the OPML file, you will lose your categories.

——————-

To sum up: try not to ever have to move your WordPress blog from one server to another, and you will add years on to your life.

Happy blogging!

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Happy birthday to WordPress Garage!

Friday, February 22nd, 2008

Birthday Cake

Today, WordPress Garage turns one year old. Hasn’t our little baby grown up fast? Blow out the candles…

It is exactly one year ago today that I wrote my first post here. It was about Jerome’s Keywords Plugin, which was a popular plugin for creating tags in WordPress before they became a built-in feature.

The reason I started this blog is because at that time, I was building web sites for clients, but felt that I could not justify creating static sites anymore. I was searching desperately for a solution that would enable me to create sites with a content management system that wouldn’t break the bank, and that I could manipulate and customize without being a programming wizard.

I looked into many open source options, and found that WordPress was easiest to use from the designer/developer’s point-of-view, and from the user’s point-of-view. So my company started building sites on WordPress. As we built, we learned a lot and I felt like we really need a good way to organize the information we were gathering about good plugins and how to use them, themes, and code hacks.

And thus WordPress Garage was born. Between WordPress’ categories, tags, and the search function, I figured we’d always be able to locate the information we need within minutes.

Apparently, others also were looking for this information, and readership grew as well, which is good because it’s a lot more fun to write when you know people are listening.

Birthday presents

In honor of WordPress Garage’s birthday, I have two new presents:

  1. A WordPress Garage facebook page! If you like this blog, please come on over to this page and become a fan. I’d really like to get to know my readers a bit more.
  2. The WordPress Garage YahooGroup - I’m on the WordPress Pro mailing list, which is about the most dry and boring list on earth. I suggested that the list become more active, and while people said it wasn’t appropriate for that list, they liked the idea. So, this email list’s goal is to be a place where people can help other people with their WordPress issues. Looking for that perfect plugin? Can’t figure out why your blog is breaking? Join the list and ask!

Statistics and summary

It’s fun to compare my first month on WPG to this last month. Site visits have gone up 1,424%, and pageviews have gone up 841%. Now I get almost 8000 visitors a month according to Google Analytics, and over 14,000 page views. Most of my visitors come from Google Search, with the rest coming from StumbleUpon and other sites. My top referring sites in order of traffic are:

Most popular posts

The most popular posts on WPG at the moment are:

Best WP Garage tips

These posts aren’t necessarily the most visited, but the tips in them are pretty useful:

Most controversial posts

A little bit of controversy adds color to an otherwise boring monologue about loops and plugins. I don’t like to create conflict, but getting people to participate in an active discussion is just fun.

Consumer evangelists vs. lawyers: using “WordPress” in domain names - this is the post where Matt Mullenwegg commented three times. In this post, I argued that WordPress shouldn’t shun blogs (like mine) that use the word WordPress in their domain name, and should rather embrace these consumer “evangelists” who love the product so much that they volunteer their own time to talk or blog about it. After I wrote this post I finished Meatball Sundae by Seth Godin, and he also talks about this idea.

Anyways, Matt and Lorelle didn’t like my opinion, and accused me, or those like me, of “blatant[ly] disregard[ing]…a core tenet of our community,” of being like a scraper, and of legal violations. In the end Matt kind of softened up and he said he’s “thrilled about [me] or anyone who blogs about WordPress.” He said if I want clarification about their policies I should feel free to email or call him. So, mustering up some good ol’ Israeli chutzpah, I called him and left him a message. Despite his generosity, I think this blog is still shunned by the WordPress powers-that-be. Oh well.

Would we use WordPress if there were no plugins? - I just threw out this question to make us think about how valuable WordPress would be on its own. I think it’s value lies in the fact that it supports plugins.

ZDNet says WordPress not clunky, but also not CMS - I referred to an article by ZDNet about whether WordPress is a CMS and sparked a lively discussion.

WordPressGarage is being scraped! I want to stop them…now! - I realized that one particular site was scraping all of my content and republishing it. I threw the issue out to my readers, and got some interesting responses in the comments.

Is WordPress’ security vulnerable at its core? - WordPress is being upgraded all the time because of security issues. Plugins also have constant security vulnerabilities. Is this standard, or is there a problem with WordPress? BlogSecurity.net said there’s a problem with WordPress. Read the post to find out more.

Milestones

  • Someone told me that I’m one of the coolest people in the WordPress community! Can you believe it? (No, it wasn’t my mother.) While in the real world I am far from being considered cool (mother with lots of kids who works hard to pay the bills with little time for play), I guess that in the WP community my geekiness is…cool…or something.
  • WordPressGarage listed as one of Top 40 Blogs About WordPress!
  • I’m sure there was something else I got excited about over this past year, but I can’t remember.

So happy birthday WordPress Garage, and may we enjoy another fun year of WordPress blogging together!

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

WordPress Database Backup

Thursday, February 22nd, 2007

Crucial to the survival of your blog beyond crashes and natural disasters. Now being managed by Il Filosofo.

WordPress Database Backup>>

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Premium News Themes