A month or so back I took the Content Migrate module from the CCK project and created a Nodewords Migrate module based on that. This is a rough starting point, but it works! One known issue is that it saves duplicate values where they should be inherited. This does not affect functionality at all and saving the Meta Tags form after the migration cleans this up.


sahuni’s picture

Thanks for sharing.
I want to give a try because I need the upgrade path too.
I just have descriptions and keywords.

What are we supposed to do?
Install metatag
install nodewords_migrate
run the migration
remove the nodewords directory

If not, tell me how to do it.

jantoine’s picture

Hi sahuni,

That is pretty close to how I use it. Here is exactly how I am using it to date:

  1. Install the Metatag module
  2. Install the Nodewords Migrate module
  3. Run the migration
  4. Save each of the Metatag configurations (Only needed until the bug where inherited values are re-declared is fixed)
  5. Disable/Uninstall the Nodewords Migrate module
  6. Delete the Nodewords Migrate module directory
  7. Manually delete any Nodewords tables in the database

Hope that helps!

likewhoa’s picture

nodewords_migrate currently fails with:

PHP Fatal error:  Cannot redeclare content_migrate_drush_help() (previously declared in sites/all/modules/cck/modules/content_migrate/includes/content_migrate.drush.inc:11) in sites/all/modules/nodewords_migrate/includes/nodewords_migrate.drush.inc on line 24

Fatal error: Cannot redeclare content_migrate_drush_help() (previously declared in sites/all/modules/cck/modules/content_migrate/includes/content_migrate.drush.inc:11) in sites/all/modules/nodewords_migrate/includes/nodewords_migrate.drush.inc on line 24
Drush command terminated abnormally due to an unrecoverable error.                                                                              [error]
Error: Cannot redeclare content_migrate_drush_help() (previously declared in
sites/all/modules/cck/modules/content_migrate/includes/content_migrate.drush.inc:11) in
sites/all/modules/nodewords_migrate/includes/nodewords_migrate.drush.inc, line 24
Krate’s picture

Hi, I was in need of migration also and tested the sandbox version. Not working atm. I might run own test for it.

Tried running the migrate and I get few hundred of these:

Notice: Undefined index: value in function nodewords_migrate_migrate() (row 46 in file /mysite.com/sites/all/modules/nodewords_migrate/includes/nodewords_migrate.admin.inc).

gkatsanos’s picture

I get a 500 internal server error when running the migration.. .

likewhoa’s picture

Status: Active » Needs work

this needs work

jantoine’s picture

Status: Needs work » Needs review
1.97 KB

All the content_migrate errors are due to the fact that I used the Content Migrate module as a starting point and didn't clean up all the left over cruft. All the Content Migrate code has been removed and I attempted to fix the issue from #4. New file attached.

jantoine’s picture

1.97 KB

My attempt to fix the issue from #4 failed... I used the wrong check. Attached file has proper fix.

pipicom’s picture

Following #2 instructions and applying #8 module, transition was uber smooth.. Respect Mr. Antoine :)

a1tsal’s picture

Status: Needs review » Reviewed & tested by the community

Worked for me.

drupalninja99’s picture

Status: Reviewed & tested by the community » Needs review
3.06 KB

I have taken #8 and just adding a drush include so that you can run the migrateion as "drush nodewords-migrate" and that worked well for me. Thanks for this module!

drupalninja99’s picture

3.14 KB

In #11, I had the module name 'nodewords' instead of 'nodewords_migrate' - here is the correct zip.

DamienMcKenna’s picture

Status: Needs review » Needs work

Minor quibble - it should be named metatag_migrate :)

Scrap that, nodewords_migrate is fine.

I'll do a more thorough review later.

DamienMcKenna’s picture

DamienMcKenna’s picture

Status: Needs work » Closed (fixed)

Lets *cough* migrate the discussion over to #1281138: Upgrade path: Nodewords :-)

stuart.crouch’s picture

2.46 KB

Sorry to resurrect a dead thread, but as Damien is still working on making MetaTag stable this is still the best thread for those of us that need to upgrade our sites now (eg we cant wait any longer because our bosses are demanding a Drupal 7 upgrade).

The nodewords_migrate module allowed me to quickly import all of the keywords and descriptions for my site, but it was specifically coded to ignore the robots data that we needed. I've added an import for the robots data to the code. The version I've coded is for the ill-fated 6.x-2.x branch, which we used and then couldn't revert. I don't know if it would cause issues with the 6.x-1.x branch as I'm not sure how that handles the robots storage format.

philsward’s picture

Getting the following error from using metatag-1.0-beta4 (See below for temporary solution)

Missing argument 4 for metatag_metatags_save(), called in /home/user/public_html/t/upgrade/sites/all/modules/contrib/nodewords_migrate/nodewords_migrate.admin.inc on line 99 and defined metatag.module:375

No clue how to fix this programmatically...

philsward’s picture

If you are looking to migrate your nodewords -> metatag and stumbled across this post, you will run into some issues with the latest version of Metatag. Assuming you are coming from Nodewords v1.x and you have successfully upgraded your site to Drupal 7, the solution is as follows:

Initial Thoughts:
- Keep in mind this ONLY converts keywords and descriptions...
- Unsure if this converts sitewide (global) keywords. You might copy those somewhere before migrating.

Migration Steps

  1. Install the 1.0-alpha6 version of metatag
  2. Install the Nodewords Migrate module or the Nodewords Migrate module with Drush (yes enable it like a normal module)
  3. (GUI) Run the migration from /admin/structure/nodewords_migrate (CLI) Use drush to run the migration drush nodewords-migrate
  4. Save (Override) each of the Metatag configurations on /admin/config/search/metatags
  5. Disable/Uninstall the Nodewords Migrate module
  6. Delete the Nodewords Migrate module directory
  7. Update to the latest version of the Metatag module
  8. Manually delete any Nodewords tables in the database
Summit’s picture

Status: Closed (fixed) » Active

I set this to active again because I think this is the best place to look into Nodewords migration, right?
I have also the nodewords_custom table based on Nodewords for other pages. Will this get into the D7 Metatag migration somehow?
greetings and I am sorry if this thread was set closed with a purpose.

Using procedure of #18 and using migrate module of #12 I got following errors by step 3 admin/structure/nodewords_migrate

Warning: Missing argument 4 for metatag_metatags_save(), called in sites/all/modules/nodewords_migrate/nodewords_migrate.admin.inc on line 99 and defined in metatag_metatags_save() (line 385 of sites/all/modules/metatag/metatag.module).
Notice: Undefined variable: language in metatag_metatags_save() (line 387 of sites/all/modules/metatag/metatag.module).

This error is shown for every record I think...
I did install: 1.0-alpha6 version of metatag!
For instance the node and taxonomy term metatags are not converted.

greetings, Martijn

DamienMcKenna’s picture

Status: Active » Closed (fixed)

I've pushed up the branch that I was working on, lets focus on improving that.

subhojit777’s picture

2.03 KB

Thanks @jantoine for your work. I think this module should be included in metatag module as nodewords upgrade path. However I have changed some parts of your module and uploading it.

Previously, the module was not migrating all the metatags, it was ignoring metatags like revisit-after. Also it provided upgrade for only node entity type. The module I have uploaded will migrate all metatags and will also upgrade metatags for entity types like user and taxonomy term.

My Drupal 6 site was also using nodewords_pagetitle module. I was using this patch for upgrading page titles to metatag. But after upgrade, when I am migrating nodewords using jantoine's module the previously set title was lost. The module I have uploaded will retain the page title.

Hope this helps.

subhojit777’s picture

You can follow the steps given here for complete nodewords and pagetitle migration to metatag.

subhojit777’s picture

2.04 KB

Module provided in #21 in not correct. Returns error in certain cases and also does not merges metatag information. Here is the correct module.

xenophyle’s picture

This module seems to have migrated from Nodewords ok, but I needed to make a couple changes to the code before it would work:

- metatag_metatags_load() expects the first parameter to be an integer, so up where the $metatag object was defined, I added 'entity_type_id' => $result->type, and used $record->entity_type_id as the first parameter to metatag_metatags_load().

- In the line $existing_metatags = reset($metatags), I got rid of the call to reset, as this caused $existing_metatags not to be an array, which caused an error in the following call to array_merge().

- In the call to metatag_metatags_save I added a 4th parameter (value FALSE) to avoid the missing-parameter message.

Thanks for the module -- very helpful!

stuart.crouch’s picture

You guys seem to have reverted the code a lot...

The new version undoes some of the code I added, then re-implements parts of it but not quite right. It leaves other bits out of the new code, and completely removes the drush code! I'm going to attempt to merge the two code bases and run it as part of a migration.

stuart.crouch’s picture

Issue summary: View changes
2.36 KB

I ran this new merged version against my code. When checking the results the robots and the node specific content both came through, nothing errored and I think the merge of the two makes sense. Others may want to test it to ensure their enhancements still work but please don't go modifying earlier versions of the module again :$!

To aid this, I've hidden the older versions of the module.

stuart.crouch’s picture

jarchowk’s picture

I had trouble getting this to work with a multi language site. I had to add to add the language where the metatag_metatags_save() is called:

$language = db_query('SELECT language FROM {node} WHERE nid = :vid', array(':vid' => $record->entity_id))->fetchField();
metatag_metatags_save($record->entity_type, $record->entity_id, $metatags, $language);

Ambient.Impact’s picture

Hi there. I noticed a problem in nodewords_migrate.module from #26: I couldn't access the page because of incorrect access arguments on line 16. It was:
'access arguments' => array('Administer meta tags.'),

When it should be:
'access arguments' => array('administer meta tags'),

KarlShea’s picture

1.91 KB

Along with the permissions change, I had to change some code to make it work with the latest version of metatag; diff is attached.

This also enables migration into terms and vocabularies.

dkalish’s picture

I am getting WSOD using nodewords_migrate trying to migrate from D6.33 to D7.31. I followed the directions in #18 after applying the patch and #29. When I get to the stage of overriding the Metatag configurations, I see only 5 entries (Global, Global: Front Page, Content, Taxonomy, User) and each only has something about the site name in it. I'm choosing the current release of Metatag when it comes time to upgrade it. When I then complete the remaining steps, the only page I can navigate to is my home page, the rest are WSOD. Any ideas?

DamienMcKenna’s picture

Lets move the discussion over to #1281138: Upgrade path: Nodewords and leave this discussion closed.

skrael’s picture

I guess this serves as a warning. Avoid drupal modules wherever possible.

I have spend a DAY trying to figure out how to convert D6 nodewords to the D7 metatag module. I am not a coder. I don't use drush (whatever that is). I am (clearly) a late adopter because of my non-technical nature.

I looked into "applying patches" only to get confused.So apparently I need extra software or "drush" to apply a patch? Screw that - I am no coder. I managed to dowload the "nodewords_migrate.tar_.gz" file (won't install via D7 from a URL, so I had to "save as"the file then upload va FTP to the site/all/modules) result? Nothing.

My solution? I guess I will have to enter ALL metatags manually post D7 upgrade. Time consuming? Yup. But as it seems reliance on contributed Drupal modules is a gamble (case in point: whatever happened to that "WebFM module" that everyone was raving about) I guess that is the "price you pay" for being non-technical and choosing Drupal.

/frustrated rant.

Summit’s picture

I am also in this process. I am now turning my conversion complete different.
I will try to use migrate with a clean drupal 7 site, and through that route try to get the stuff in.
There is a migrate module as you say. My nightmare becomes more a dream comes true if this will work...

jenlampton’s picture

There is a patch at https://www.drupal.org/node/2872446 that's a start on the drush command for upgrading from Nodewords.