I have moved servers so maybe my blog’s uptime will at least reach 50%. Yesterday, when confronted with the task of migrating from Despayre, I thought the steps would be simple enough. I installed WordPress 2.1.2 on Alcopop and also upgraded Despayre to the same version. A new feature of the blogging software is an import/export feature, using XML as the intermediate format. This would be a useful feature, if it actually worked. Exporting was fine, a 1.8 megabyte file was downloaded. When I attempted to import to Alcopop, I received a memory allocation error message. After a few Google searches, the solution I tried was to add “php_value memory_limit 20M” to ~/public_html/.htaccess. The next upload attempt went further, to a point where I instead got a blank page! Folder ~/public_html/wp-content/uploads shows my uploaded XML file with the proper file size, however the WordPress import module refused to parse it. So I said fuck that noise, let’s try a direct SQL migration. I created a ~/mysql/ directory and tried:
mysqldump –user=afterglow -password=etc –tab=~/mysql/ –opt afterglow
This resulted in an error about locked tables. I messaged arioch to either reboot Apache or ensure I had full permissions to unlock tables. Today, I tried again, with error message: “mysqldump: Got error: 1045: Access denied for user ‘afterglow’@’localhost’ (using password: YES) when executing ‘SELECT INTO OUTFILE'”. I tried different directories. Same error. I tried another backup method outlined in the MySQL 5.0 docs:
mysqlhotcopy afterglow ~/mysql/
Error message: “Cannot open dir ‘/var/lib/mysql/afterglow’: Permission denied at /usr/bin/mysqlhotcopy line 295”. Ok. So maybe a direct copying of the database files was necessary. On both Despayre and Alcopop, I tried:
find / -name “*.myd” 2>dev/null
Also searching for *.myd and *.frm only resulted in showing the base permission and configuration tables used by MySQL. Finally I found a solution:
mysqldump –user=afterglow –password=etc –opt afterglow > wp.sql
So I transferred that file to Alcopop, ran:
mysql –user=afterglow –password=etc –database=afterglow < wp.sql
That successfully went through… or didn’t. http://afterglow.alcopop.org was now blank, and visiting http://afterglow.alcopop.org/wp-admin instead redirected to http://afterglow.despayre.org/wp-admin. WP-Admin->Options->WordPress address (URL) and Blog address (URL) must be set to the domain, so in MySQL I edited the wp_options table where option_value = ‘http://afterglow.despayre.org’, setting it to this domain.
With the front page blank, I went into WP-Admin->Presentation but it didn’t show any themes, even though ~/public_html/wp-content/themes/ had a directory containing a theme. I uploaded the Almost Spring theme, then both themes finally displayed in the admin screen. Now everything was fully migrated.
I decided to just go with one admin login rather than the additional user I used to post on Despayre, so I attempted to delete the extra user and assign all the posts and comments to the admin. Error time! “You have specified these users for deletion: ID #2: Afterglow The current user will not be deleted. There are no valid users selected for deletion”. So the hundreds of posts made by that user must also not be valid. I’ve just said fuck it and I’m going with the two logins.
All that work for a bunch of banal posts, including this one. Rock on. I will be posting my top albums of 2006 list sometime within the next month. So that’s something to look forward to, I guess?