WordPress

WordPress upgrade plugin

October 12th, 2008

I just completed an upgrade of WordPress using the WordPress Automatic Upgrade plugin. I went from 2.2.3 to 2.6.2 without a hitch. It took me about 15 minutes.

The only thing I'd say is that I'm not sure I trust the backups the plugin makes. I had a look in the zip file and it didn't have a wp-content directory. So I'll continue to do manual backups, as follows:

1. Using FileZilla, download the whole WordPress directory (in my case this is the Web root directory, called web), with the exception of a couple of things that live within the wp-content directory:

  • advanced-cache.php
    This seems to be a link that FileZilla doesn't understand and treats like a directory, but drops the connection if you try to download it.
  • cache
    This directory won't reveal its contents and, again, the connection drops if you try to download it.

2. Backup your data using phpMyAdmin (see this tutorial, or this one) and save the SQL somewhere safe.

That said, I'm very impressed with this upgrade plugin. I'd been resisting upgrading because I was sure it would cause me pain. However, everything seems to be working, even PodPress.

The following video (there are 2 parts to it) is very slow-paced but it does go through the process very thoroughly. It also shows how to use the WordPress Database Backup plugin, which I'm just about to try out.

Leave a comment

 

Migrating a hosted WordPress site to your local PC

October 12th, 2008

This has wasted me hours and hours of time and effort, but I eventually got there. I want to move my WordPress site up from version 2.2.3 to the latest version 2.6.2.

I don't like to put myself through the pain of upgrading every time there's a new WordPress version, but I'm quite far behind now and there's a particular plugin I want to use which won't work under 2.2.

So, before upgrading live, I thought I'd migrate everything onto my laptop, do an upgrade there and see how I get on. If it just doesn't work, or breaks PodPress, for example, then I won't bother trying it on my live site.

Theorectically, migrating should just be a case of:

  • Download all the files using FTP.
  • Export the data from MySQL.
  • Put Apache and MySQL on my laptop using XAMPP.
  • Put all the downloaded files into the web directory hierarchy.
  • Create a new database on the laptop with the same name and user as on my web host.
  • Import the data into this new database.

That's basically what you do but, as ever with this kind of thing, it's the fiddly little extra things you have to do to make it work that always trip you up and take forever to figure out.

The best directions (though neither of them complete) for doing this task were:

http://mark-kirby.co.uk/2008/how-to-create-a-local-copy-of-a-wordpress-site/

and

http://www.aniquito.com/2008/08/12/how-to-move-wordpress-from-hosting-site-to-local-computer-or-to-a-new-domain/

The latter is good because it has some search/replace commands that you can run in phpMyAdmin to replace full URLs with relative paths.

There's also:

http://weblogtoolscollection.com/archives/2008/01/03/install-wordpress-locally-part-2-of-2/

Which doesn't add much, but contains some information about large SQL files and phpMyAdmin.

I mainly used the first of those pages. However, additional points to note before following these instructions:

  1. Disable all plugins before exporting the data and downloading the files (you can turn them back on later, once everything else is working).
  2. Make sure you've change the siteurl and home options in phpMyAdmin. After changing them search again and make sure they really have got the localhost value in them now.
  3. Comment out the WP_CACHE line in the wp-config.php file:

    <?php
    // ** MySQL settings ** //
    //define('WP_CACHE', true); //Added by WP-Cache Manager
    define('DB_NAME', 'mydb');    // The name of the database
    define('DB_USER', 'mydbuser');     // Your MySQL username
    define('DB_PASSWORD', 'fiendishlycomplicatedpassword'); // ...and password
    define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');

    For a long, long while, when I browsed to the local site I got redirected to the Web site home page. I puzzled with this for hours and eventually after trying lots of different things, it went away. I'm not quite sure how I solved it. I think it was something to do with caching, so make sure you comment out the line above if you use the wp-cache plugin.

  4. Make sure the DB_HOST in this file is localhost. It should be anyway, but mine wasn't.
  5. If you want to use permalinks, you will need to make a change inside Apache's httpd.conf file.

    In my case this is located within this directory:
    D:\programs\xampp\apache\conf

    Open that in a text editor. Use the search facility in the editor to find "rewrite". The line you need looks like this:

    #LoadModule rewrite_module modules/mod_rewrite.so

    You need to take away the hash sign so it looks like this:

    LoadModule rewrite_module modules/mod_rewrite.so

    Save the file.

  6. Make sure the .htaccess file in the root of your wordpress directory (in my case this directory is called itauthor) contains the following:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /itauthor/index.php [L]
    </IfModule>

    Note the name of the wordpress directory in the RewriteRule. You may need to change:

    RewriteRule . /index.php [L]

    to:

    RewriteRule . /yourwordpressdirectory/index.php [L]

    If the WordPress files aren't in the root of your web server.

  7. Now restart the apache2 service in the Windows services dialog box.
  8. Live Writer likes to use URLs, so if you use it to post to your blog you'll probably have to spend a while carefully searching/replacing URLs to relative paths. For me, I wasn't too bothered as I'm just going to use this as a sandbox for checking the effects of running through the upgrade process.

Leave a comment



WordPress anguish

September 15th, 2008    9 Comments

After many hours of Googling and much trial and error I have finally given up on my hope of making a minor improvement to this site.

All I wanted to do was to make comments, and the comments form, show up at the bottom of each post, no matter what type of page it appeared on. By default, comments in WordPress only show up if you display a post on a page of its own. I know a lot of people who visit this site click the Podcasts tab. This displays posts in a category view, which means the comments form is not displayed.

WordPress, like MovableType, demands an extremely high degree of patience of anyone who wants to configure their own site. WordPress isn't as bad as MT in this respect (hence my decision a few years ago to make the switch across to WordPress), but it can still sap hour upon hour of your free time to make what you might expect would be the simplest of changes.

Given the popularity of blogging, there is real scope for someone to come in here and steal a market away from WordPress. I wonder what Google and Microsoft have up their sleeves? Microsoft already have the best tool for writing blog posts (Live Writer), I wouldn't be surprised if they had a WordPress killer among their plans for Live.

So for now, unless you're reading this on the front page or on a single-post page, if you want to comment on this post you're going to have to click on the heading above to display it singly and then scroll down to the comments form.

Potentially similar posts

Leave a comment



Line breaks in WordPress

August 14th, 2008

Usually I use LiveWriter to post/edit blog posts, but occasionally I have to revert to doing things in the horrible WordPress editor.

One annoying thing about this editor is that it removes your line breaks. For example, suppose you're in a list and you do a couple of shift-returns to add a new paragraph within the same point in the list (i.e. an indented paragraph that's not numbered). WordPress will remove the <br/> tags and close up the space. This might not happen straight away but it will happen if you reopen the post in the editor.

Even if you go into code view and manually type in <br/>, WordPress will take them out. It seems to think it knows better. So you have to prevent it recognising the <br/> tags by entering them manually in code view as:

<br align="left" />

Potentially similar posts

Leave a comment



ITauthor back up again

March 11th, 2008

The site has been up and down, there and not there, recently. This is for a number of reasons but mainly because Sky cut off my internet connection which meant that - because my site was hosted from an old PC running Linux, sitting in a basement cubby hole in my house - my Web site disappeared.

At around the same time some of my domain names came up for renewal and when I was renewing itauthor.eu with Euro-Reg.com I decided, on the spur of the moment, to buy a hosting package and move everything onto their servers. You may have noticed that, at the time of writing at any rate, the URL for the site is .eu rather than the usual .com.

Things may change because I subsequently realised that Euro-Reg only allows me 500MB of space, which isn't enough to put everything up that was originally on my site (so you may notice some missing pics etc.). I think I might move everything over to Dreamhost, but for the time being it's working OK where it is and it means I can save a bit of electricity by turning off my Web server.

If you've visited before you may notice that the site runs a little faster than before - not a huge amount though, which is a little disappointing given that I got a tiny upload speed from Sky.

The downside of moving things to Euro-Reg is that I have no command line access and I have to move files via FTP. I'd forgotten how slow and arduous FTP is. I'd got so used to using WinSCP for putting stuff on my Web server. I'd kind of consigned FTP to history and thought I'd never use it again. Funny how things turn around.

However, the big gain from moving my WordPress blog onto someone else's server is that - for reasons unknown - the "Next/Previous" links in WordPress that had never appeared before now work just fine. I'd spent ages in WordPress forums trying to get these links to show up, without success, so it's nice that the site is now much more accessible and you can get more than 5 search results now.

Potentially similar posts

Leave a comment



^ back to top ^

Page 3 of 512345