Archive for Linux

How To Duplicate a PGSQL database

Recently I needed to create a duplicate of PGSQL database.  Being a MySQL guy, I didn’t know off hand how to do it, but here is an easy way:

pg_dump original_db > original_db.sql
createdb new_db
psql -d new_db < original_db.sql

From a bird’s eye view, you are creating a dump of the original database and outputting it to a file. From there, make sure the new database is created and use your dump file as input for that database. It wouldn’t be too hard to make this into a one-liner, but I like to see intermediate steps to make sure things are going well.

Upgrading Wordpress MU from 2.6 to 2.7

I know I’m late to the game but I tried upgrading wordpress from version 2.6 to 2.7 today.  I ran into the seemingly all-too-common redirect loop which seems to have to do with the wp-config.php keys and salts.

Thanks to a comment on the wordpress forums, I was able to find a resolution, which was to remove the block of KEYS and SALTS entirely from the wp-config.php file.  Then, upon login, MU notifies you that your keys are incorrect and asks you to update them.  A simple fix to something that I thought would be a major problem.

I have to say, Wordpress 2.7 is significantly better than 2.6 AND 2.7 MU is even better than that if you are running multiple blogs.  What fun!