Moving WordPress again

I have been running my blog on the URL for years. If you are familiar with WordPress then that’s an OK URL to use but most people are more comfortable with a generic name.

I did not want to use (already used for a place holder) and did not want to put move to a folder off of the web server. So I picked and moved my WordPress install this morning.

It went very well.

I created a new virtual server for on my server and enabled it in Apache 2 (a2ensite and copied all of my files from the old wp directory to the new blog directory.

I used my nightly backup script and produced a text file of my mysql database. I then ran this command on that text file:

$ cat wp-database.sql | sed -e 's/' > new-database.sql
$ cat new-database.sql | mysql -D blogdbname -u blog-user -p

I did it that way on purpose so that I could always restore the old setting if I messed this up. By hunting through and changing every instance of to in the database backup file, I guaranteed that even obscure plugin settings would get updated as well.

In my old directory I moved everything out and left a two line .htaccess file like so

RewriteEngine on
RewriteRule (.*)$1 [R=301,L]

That way any hits to will get 301 Permanently Moved to the same URL but on

After a little testing everything is confirmed to be working. I am in the process of updating my stats settings in Clicky and Google Analytics but so far so good.