pipes and monkey wrenches

Perhaps this should have been titled “backup backup backup“. This is a mantra that is often told but not as often followed and failing to do so can affect anyone.

I was almost ready to go live with my site when I asked for some assistance. A friend of mine who is familiar with the services of my host helped me with some of the friendly tools that were available. I had mistakenly installed my site under the default instance directory.

The tool, Plesk control panel from ODIN. The tool can probably do it all, mail server, firewall, backup, databases and statistics just to mention a few of its capabilities.

Well, it is no fault of the tool that the wielder is having problems with it. I started on the bare metal and once I started to control the environment with Plesk the center of reference moved.

My data was not lost, but the locations for the web pages were moved, and wordpress remembers where it was installed.  A quick query of the wp_posts table shows that the posts are there which was what I was concerned with, yet this table also contains any revisions and indeed just like word processing, it is a good idea to save your work often.

I simply extracted my text which now had pipe symbols at various spots in the articles.

There are some simple things that can be done to prevent reliving this situation.

  • wordpress extraction of data
  • database backups

WordPress provides a pair of scripts designed to extract and import setup.

http::/example.com/wp-admin/export.php
http::/example.com/wp-admin/import.php

The names really do say it all.  Simply point your web browser at your site and you can download the extract directly to your computer.

Database backup tools are more of a personal thing.  Either find a comfortable front end for mysql or do a bit on the command line.  For the moment, I have decided for a small script which will dump the database into a dated file.

#!/bin/bash
DBOWN=myadmin
DBPWD=somepass
DB=mydatabase
mysqldump -u$DBOWN -p$DBPWD $DB > dbdump-`date +%Y%m%d`.sql

A real paranoid sysadmin would not put the password into the file and would be prompted for a password.

#!/bin/bash
DBOWN=myadmin
DB=mydatabase
mysqldump -u$DBOWN -p $DB > dbdump-`date +%Y%m%d`.sql

This entry was posted in blogging and tagged , , . Bookmark the permalink.