Posted by davidinnes on November 2, 2009 at 4:45am
I recently imported 3000+ MovableType posts and 14,000+ comments into Drupal with the Table Wizard and Migrate modules. Now, unfortunately I need to change the input format for all posts to Textile (format ID #4 in my system.)
I've looked for modules that would let me do it but I think it's an obscure enough task that nobody's written one.
Is there a more efficient way than hand-editing to do the conversion?
Just a pointer to the right table(s) in the database would be enough since I'm very familiar with SQL, but if there's a proper way to do it with PHP and Drupal hooks (which I'm not so familiar) I'd use that instead. (I'll be backing up the database early and often either way.)
Thanks.
Comments
=-=
node_revisions table format row I think.
Got it!
I don't think I'd have ever looked for it there. It worked perfectly. Thanks, VeryMisunderstood!
---
Example queries:
To backup the database first
mysqldump --add-drop-table -u username -p mydatabasename > mydatabasename_backup.sqlTo convert nodes with the default HMTL (format #2) to custom filter Textile on my site (format #4)
UPDATE node_revisions SET format = 4 WHERE format = 2To convert all nodes on my site to Textile (I was sure that's what I wanted to do, plus I had a backup)
UPDATE node_revisions SET format = 4thanks!
thanks to you both. I'm just figuring out SQL, so your detailed reply with instructions on how to make it work helped immensely. Worked like a charm.
Big Thanks !
Glad that i found the solution here. You are just one step ahead of me asking the question. Nice solution though.
WootManga - My Favourite Online Manga Reading - Powered By Drupal !
Take a look at
Take a look at http://drupal.org/project/formats_updater
awesome
Just what I was looking for. Not sure it actually works though.
Freelance Web Design and Development
---
http://www.danlobo.co.uk
For Drupal 7
For Drupal 7, the syntax is:
UPDATE `field_data_body` SET `body_format` = 'markdown'if one wants to change to markdown.
For the name of other available formats, just browse the table
field_data_bodyand look at thebody_formatfield.or
UPDATE `field_data_body` SET `body_format` = 'markdown' WHERE format = 'full html'Convert Body
Is there any way to do this while also running all the node bodies through the current input filter? We are converting a bunch of wiki nodes which are wiki text to html.