Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#30 | fixed.diff | 1.91 KB | KarlShea |
#26 | nodewords_migrate.tar_.gz | 2.36 KB | stuart.crouch |
Comments
Comment #1
sahuni CreditAttribution: sahuni commentedThanks 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
update.php
remove the nodewords directory
If not, tell me how to do it.
Comment #2
jantoine CreditAttribution: jantoine commentedHi sahuni,
That is pretty close to how I use it. Here is exactly how I am using it to date:
Hope that helps!
Comment #3
likewhoa CreditAttribution: likewhoa commentednodewords_migrate currently fails with:
Comment #4
Krate CreditAttribution: Krate commentedHi, 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).
Comment #5
gkatsanos CreditAttribution: gkatsanos commentedI get a 500 internal server error when running the migration.. .
Comment #6
likewhoa CreditAttribution: likewhoa commentedthis needs work
Comment #7
jantoine CreditAttribution: jantoine commentedAll 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.
Comment #8
jantoine CreditAttribution: jantoine commentedMy attempt to fix the issue from #4 failed... I used the wrong check. Attached file has proper fix.
Comment #9
pipicom CreditAttribution: pipicom commentedFollowing #2 instructions and applying #8 module, transition was uber smooth.. Respect Mr. Antoine :)
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedWorked for me.
Comment #11
drupalninja99 CreditAttribution: drupalninja99 commentedI 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!
Comment #12
drupalninja99 CreditAttribution: drupalninja99 commentedIn #11, I had the module name 'nodewords' instead of 'nodewords_migrate' - here is the correct zip.
Comment #13
DamienMcKennaMinor quibble - it should be named metatag_migrate :)Scrap that, nodewords_migrate is fine.
I'll do a more thorough review later.
Comment #14
DamienMcKennaBTW I'd love to include this as part of Metatags :)
Comment #15
DamienMcKennaLets *cough* migrate the discussion over to #1281138: Upgrade path: Nodewords :-)
Comment #16
stuart.crouch CreditAttribution: stuart.crouch commentedSorry 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.
Comment #17
philsward CreditAttribution: philsward commentedGetting the following error from using metatag-1.0-beta4 (See below for temporary solution)
No clue how to fix this programmatically...
Comment #18
philsward CreditAttribution: philsward commentedIf 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
Comment #19
Summit CreditAttribution: Summit commentedHi,
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
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
Comment #20
DamienMcKennaI've pushed up the branch that I was working on, lets focus on improving that.
Comment #21
subhojit777Thanks @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.
Comment #22
subhojit777You can follow the steps given here for complete nodewords and pagetitle migration to metatag.
Comment #23
subhojit777Module provided in #21 in not correct. Returns error in certain cases and also does not merges metatag information. Here is the correct module.
Comment #24
xenophyle CreditAttribution: xenophyle commentedThis 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!
Comment #25
stuart.crouch CreditAttribution: stuart.crouch commentedYou 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.
Comment #26
stuart.crouch CreditAttribution: stuart.crouch commentedI 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.
Comment #27
stuart.crouch CreditAttribution: stuart.crouch commentedComment #28
jarchowk CreditAttribution: jarchowk commentedI 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);
Comment #29
Ambient.ImpactHi 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'),
Comment #30
KarlSheaAlong 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.
Comment #31
dkalish CreditAttribution: dkalish commentedI 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?
Comment #32
DamienMcKennaLets move the discussion over to #1281138: Upgrade path: Nodewords and leave this discussion closed.
Comment #33
skrael CreditAttribution: skrael commentedI 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.
Comment #34
Summit CreditAttribution: Summit commentedHi,
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...
https://www.drupal.org/node/2464003
gr,
Martijjn
Comment #35
jenlamptonThere is a patch at https://www.drupal.org/node/2872446 that's a start on the drush command for upgrading from Nodewords.