Last updated 7 June 2014. Created on 11 December 2009.
Edited by acabouet, shamio, silverwing, gabrielu. Log in to edit this page.

I recently experienced problems from updating to a new version of nodewords and removing the nodewords_by_path module. Looks like the format in the DB for nodewords table has changed to the serialized format. The old meta information was still in the database, but it was not recognizable since the format was plain.

So I made a quick script to port the meta tags (abstract, copyright, keywords and description) from one format to another:

Create a page with PHP content and write the following: (it's recommended to backup the database first)

// PHP Code
$result = db_query("SELECT * FROM nodewords n WHERE ('copyright' OR'abstract' OR'keywords' OR'description' ) AND n.content NOT LIKE 'a:%{%}';");
while ($item = db_fetch_object($result)) {
	$new_content = array('value' => $item->content);
	 $data = array(
	    'mtid' => $item->mtid,
	    'name' => $item->name,
	    'content' => serialize($new_content) // looks like drupal_write_record() doesn't serialize this, so I do it manually
	drupal_write_record('nodewords', $data, 'mtid'); 


Looking for support? Visit the forums, or join #drupal-support in IRC.