Web

New Year upgrade with WordPress 3.3

Upgrading my desktop is a simple matter of clicking confirm. I know it is probably possible to set up WordPress to do the same, but I like to give the least amount of rights to the web-data user over my files. Here is my quick checklist of the 3.2.x upgrade to 3.3(.1)

Database backup

Don’t skimp on this step – if for some reason the upgrade fails you have the ability to restore it to it’s preupdate state. I create a full backup of the database:

mysqldump --user=root --add-drop-database --add-drop-table --complete-insert --routines -p WORDPRESS_DB > mysqldump_WP_TODAYSDATE.sql

Note that I like using complete inserts and drop tables for ease of reading (and to closely follow more standard SQL).

New code shuffle

Download the new version of WordPress and expand the files. I don’t backup the uploaded wp-content – I simply move them from the old locations to the appropriate directories in the new codebase. This way a backup of the old code also exists. Also worth noting that before moving the directories and files you need it’s probably a good idea to set the WordPress site under maintenance.

Here is the list of items you will simply need to move over:

  • /wp-content/uploads
  • /wp-config.php – you can copy rather than move to save a backup

The other directories – /wp-content/plugins and /wp-content/themes – are a little more tedious: you compare the directory contents before you move things. However, if certain items have an update that coincides with the new WordPress then these can be upgraded directly into the new codebase.

Beware – if you have installed plugins that create their own directories outside the normal wp-content convention you will need to move these too!

Permissions

You should have all the external assets (from WordPress) in the appropriate directories of the new codebase. Now check if the permissions need to be changed – like setting the group user to the web-data user or allowing code to be executable.

After this step, it’s time for the ‘great move’.

Move and test

Move or rename the old codebase, followed by moving or renaming the new codebase to the original location. Disable the maintenance and test out your new install. If you were logged in as an administrator before the change you should be able to see if you need to confirm any database updates from the dashboard.

Hopefully all the files and plugins are still in order and your site should look…. exactly the same as it did before.

Standard

A Happy New Year, 2012!

Random

Happy New Year!

Image

Mulled Wine Hot Chocolate: a boozy winter warmer! And a chocolate and hazelnut biscotti - now all I need is a Chesterfield and a blanket with a roaring fire in the fireplace..

Random

First!

Image

Container Mall

Random

Container Mall

Image
Random

Quick and dirty ssh tunnel setup

My quick and dirty setup to set up a SSH tunnel to home machines from our remote web server.

This sets up a way to access our home machine via our remote web host – just do a ssh -p PORTNUM localhost when logged in at USERNAME@REMOTESERVER.NET

Setup of keys; creating a passphrase

First, make sure that you’ve created an RSA public/private key pair:

ssh-keygen -t rsa

I had to use this since I completely forgot the old passphrase I set up in the past. Now, rather than copy over to authorized_keys to the remote server it is far nicer to use:

ssh-copy-id -i ~/.ssh/id_rsa.pub USERNAME@REMOTESERVER.NET

Passphrase permanence

To stop you from being asked for the passphrase every time you want to SSH into the remote server do:

ssh-add

.. on the (home) machine you want to access. Follow the prompts to ‘record’ your passphrase. Now we can move onto the actual port forwarding itself.

Basic port forward

Now, on the (home) machine you did a ssh-add to, I’ve set up the forward with:

while true;
do ssh -C -R PORTNUM:localhost:SSH_PORT USERNAME@REMOTESERVER.NET;
sleep 5;
done

The SSH_PORT is normally 22. I use sleep 5 so there is some time to escape out of this infinite loop if I want to cleanly close the session running this bash script. Thus the script is left running on untouched unless I need to kill it off.

Standard

At The Radcliffe Arms

Another coffee? Sure

Random

Another coffee?

Image
red

I like red

Graphic, Random

Favourite colour

Image