Apologies for all the duplicate posts

Firstly – sorry about all these duplicate posts, it seems to be a necessary evil from the RSS reader point of view, since my feed url has changed. The good news is that there shouldn’t be too many more of them….

I’ve been pulling in my old Roller posts using http://codex.wordpress.org/Importing_From_Roller and the Movable Type importer (http://codex.wordpress.org/Importing_from_Movable_Type_to_WordPress), but I noticed that while everything imported “ok” nothing was showing up in my list of published posts.

Most annoying. After approving all the comments that were associated with those posts, ~30 posts were then publishable, but that still left around 250 to finagle.

15 minutes ago I got sufficiently annoyed (after reading this forum post) that I decided to update the db by hand. Ha!

So after a quick mysqldump of the wordpress tables + content, I ran this sequence:

mysql@mailzone:~$ /usr/bin/mysql -u $myWPusername -p
[enter passwd]
mysql> select ID,post_type,post_status from wordpress.wp_posts where post_type="post";
+-----+-----------+-------------+
| ID  | post_type | post_status |
+-----+-----------+-------------+
| 310 | post      | 1           |
| 311 | post      | 1           |
| 312 | post      | 1           |
|  28 | post      | 1           |
|  29 | post      | 1           |
|  30 | post      | 1           |
...
|   3 | post      | auto-draft  |
|  21 | post      | auto-draft  |
| 457 | post      | auto-draft  |
|  35 | post      | publish     |
|  59 | post      | publish     |
|  71 | post      | publish     |
|  96 | post      | publish     |
...
|   1 | post      | trash       |
+-----+-----------+-------------+
291 rows in set (0.00 sec)

Checking my roller database dump, I noticed it had “STATUS: 1″ for each post, which the MT importer clearly plonked verbatim into the mysql table. Now it was time for the surgical strike:

mysql> update wordpress.wp_posts SET post_status="publish" where post_type="post" and post_status=1;
Query OK, 256 rows affected (0.10 sec)
Rows matched: 256  Changed: 256  Warnings: 0

mysql> commit;Query OK, 0 rows affected (0.00 sec)