gruesome twosome

Posted by Dick on October 17, 2005

The more time I spend with them, the more I hate Tweedledum and Tweedledummer

Had another go at updating stitch last night – we just reenabled comments and are getting literally hundreds of spams a day now. Mama used to be the same but it’s been spam-free since getting textdriven last month, hence the urge to move stitch too.

Last time I tried, I stalled on one plugin that refused to play with 1.5. Needless to say this one is essential.

This time I thought I’d clone the site to stitch2, then play with the crash test dummy instance.
I thought this would be simpler than moving it to textdrive and bouncing dyndns records around. Not so.

Mysql and wordpress each had a go at fucking things up.

mysql tries it on: dump live db → test db.

mysqldump --databases livedb | mysql -u whoover testdb -p

mysqldump—databases thoughtfully sticks a ‘use livedb’ at the top of the file, so the above
actually says ‘delete the live db and reload it’. Thank $DEITY for pitiful referential integrity checking or the live site would be a smoking heap.

(you could argue that since —databases is meant to handle multiple dbs it makes sense to switch to the right db before dropping tables. File that one under ‘pilot error’.)

wordpress’ turn: siteurl

So got past that, pointed wp-config.php at the (populated) new db and ran the upgrade. The stylesheet fell off. On closer investigation, all useful links are absolute – clicking on permalinks sends you to the old vhost. If the stylesheet hadn’t moved it would have been hard to spot this. You have to

update stitch_options set \
option_value = 'http://testurl' \
where option_name = 'siteurl';

to make it worth bothering with a test instance at all.

(This one is baffling – php knows what url it was called as, right? If you generate urls based on that, you know the browser can find you again. So leaving aside the unnecassary db lookup, why would you ever want to do anything else?)

nice try, bitches

So at least I’ve got a test site up now. I have resorted to grepping through mysqldumps and the docroot to double check there aren’t any more references to the old domain. I am fully expecting to screw up the old site anyway..

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

Comments