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.
Hello,
Looking to see if there has been anyone that has tired this, success? failures? Lessons learned?
Currently on "Meta Tags Quick 7.x-2.0" stable.
Thank you!
Comment | File | Size | Author |
---|---|---|---|
#52 | metatag-n1282806-52.interdiff.txt | 6.25 KB | DamienMcKenna |
#52 | metatag-n1282806-52.patch | 10.32 KB | DamienMcKenna |
| |||
#51 | metatag-n1282806-51.patch | 6.92 KB | DamienMcKenna |
| |||
#51 | metatag-n1282806-51.interdiff.txt | 4.75 KB | DamienMcKenna |
Comments
Comment #1
rickvug CreditAttribution: rickvug commentedComment #2
mgiffordAgreed that this would be useful!
Comment #3
wellsys_world CreditAttribution: wellsys_world commentedSubscribe please
Comment #4
rickvug CreditAttribution: rickvug commented@Wellsy Note that there is now a follow button in the top right. No need to comment to subscribe!
Comment #5
wellsys_world CreditAttribution: wellsys_world commentedThanks @rickvug. Is that new?
Edit: Just seen the homepage - yes it is new. Nice
Comment #6
rickvug CreditAttribution: rickvug commented@Wellsy Yes, as of yesterday I believe. See http://drupal.org/node/1306444 for the announcement.
Comment #7
MurzHere is code snippet for copy node metatags from metatags_quick to metatag module:
Comment #8
DamienMcKennaComment #9
DamienMcKennaComment #10
HyperGlide CreditAttribution: HyperGlide commentedCross linking to #1658970: Upgrade path: Page_Title. For Page Title module migration information.
Comment #11
iamEAP CreditAttribution: iamEAP commentedHere's a drush command
metatag-import-mtq
that is essentially a more complete version of the code snippet provided in #7. In addition to the fields left out there, it handles language as expected and clears the metatag cache for all nodes.Don't know what the maintainers are thinking strategically for these "upgrade paths" (separate module, providing a GUI, etc.), but this drush command could easily be moved somewhere else and just invoked from drush in a different way.
Comment #12
iamEAP CreditAttribution: iamEAP commentedAdding a check for the existence of the Meta Tags quick field tables. Also adding some feedback about how much data is being imported.
Also realized that this doesn't take into account Meta Tags Quick path-based meta tags, which I don't use.
Comment #13
HyperGlide CreditAttribution: HyperGlide commentedThanks for the updates and patches.
We do make use of path passed meta tags on our site.
Comment #14
iamEAP CreditAttribution: iamEAP commentedHere's a patch that also takes care of Meta Tags Quick paths by generating a series of contexts. It checks that Meta Tags: Context is enabled before attempting.
Also added support for the Meta Tags Quick canonical field that the previous patches missed.
Attempted to bring over "revisit after" data, but I don't think this module supports it, currently.
Comment #15
iamEAP CreditAttribution: iamEAP commentedNoticed there was a problem migrating robots fields; Meta Tags expects them in the form
array('noindex' => 'noindex')
, while the previous patch was feeding itarray('noindex')
.This patch takes care of that. Otherwise, the same.
Comment #16
HyperGlide CreditAttribution: HyperGlide commented#15: metatag-import_from_meta_tags_quick-1282806-15.patch queued for re-testing.
Comment #17
HyperGlide CreditAttribution: HyperGlide commentedI tested this on the latest beta of Meta tag.
Path based meta tags worked.
Node meta data did not update.
Drush reported that the values where created. When inspect the Node/xx/edit and DB the values are not present.
Suggestions?
Comment #18
DamienMcKennaLets retest it.
Comment #19
DamienMcKenna#15: metatag-import_from_meta_tags_quick-1282806-15.patch queued for re-testing.
Comment #20
DamienMcKennaRelated: #1498764: Add new meta tag: Revisit-After (D7)
Comment #21
HyperGlide CreditAttribution: HyperGlide commentedWill keep an eye on this when the testing is complete will run again. Think i need a new test site or re run on the same site I used earlier?
Comment #22
HyperGlide CreditAttribution: HyperGlide commentedIs the same patch, why we expect different results?
Comment #23
HyperGlide CreditAttribution: HyperGlide commented#15: metatag-import_from_meta_tags_quick-1282806-15.patch queued for re-testing.
Comment #24
HyperGlide CreditAttribution: HyperGlide commentedRetested on a new clone of our site and the (2) meta types we where using imported properly.
They include Meta Keyword and Meta Description.
Comment #25
HyperGlide CreditAttribution: HyperGlide commentedUpdated -- after completing my testing for this issue using the Beta7 version.
I looked to test #1658970: Upgrade path: Page_Title which did include updating to the dev version.
Running updated.php etc.
The values that had once been there where gone.
I will test again and also before moving onto the page title. suggest deleting the old meta_tag_quick fields, removing the old module and installing the db tables.
Comment #26
DamienMcKennaNeeds work:
Comment #27
HyperGlide CreditAttribution: HyperGlide commented@DamienMcKenna
This issue has been focused on just the https://drupal.org/project/metatags_quick.
Is your post #26 meant to expand this issue?
metatags_quick does not support these tags.
I would agree with both.
Is best to keep this a drush command or incorporate into the module as done in #1658970: Upgrade path: Page_Title?
Comment #28
DamienMcKenna@HyperGlide: I'm not saying to expand beyond what Metatags_Quick can handle, I'm saying to expand it to cover all of the functionality that Metatags_Quick already can handle. The module uses entity and field hooks, therefore it is not strictly tied to nodes, but this upgrade script can only handle nodes.
Further:
I think this is a good first pass, but it really would be best to rewrite it to actually query the field API configuration rather than only work with a few hardcoded field names.
Basically it may be best to start from the list of meta tags supported by Metatag and see if there's an easy way of migrating any fields matching those tags. It'll be more effort, but IMHO ultimately will provide a better ex
Comment #29
HyperGlide CreditAttribution: HyperGlide commented@DamienMcKenna thanks for the detailed reply.
Comment #30
victoriachan CreditAttribution: victoriachan commentedSadly this doesn't work now that Metatag supports revision (since metatag 7.x-1.0-beta8). The revision_id column on the metatag table for the imported rows are all set to '0' (the default) as the import script didn't supply this data.
I'll see if I can quickly add this.
Thanks,
Victoria
Comment #31
victoriachan CreditAttribution: victoriachan commentedI've updated the patch from #15 to include the vid / revision_id data.
Thanks,
Victoria
Comment #32
DamienMcKennaAlso for consideration, an update script to migrate the title, description and keywords fields that uses the Fields API to identify which fields to migrate.
Comment #33
DamienMcKennaWhile my update script works for a limited use case, the real goal will be available both a drush script and through the website admin.
Comment #34
DamienMcKennaComment #35
DamienMcKennaRerolled.
Comment #37
osopolarPatch #35 won't work as metatag_update_7037() is already in use. Anyway it cant work with an metatag_update_N hook, as it does not update metatag module and I guess it won't work on a fresh installation.
I thought of it as an update for metatags_quick module and changed the function name to metatags_quick_update_7400(). I guess there won't be a version 7.x-4.x of Meta tags quick. This worked for me for a small site. A more solid solution would be create a new module for this purpose with the functionality in hook_install. This module can also take care of the deletion of the metatags quick fields, see also #1341252: Document how to uninstall Meta tags quick.
Beside the renaming of the update hook I had some minor modifications. I added a diff for the old patch from #35 to the new one. Its a normal diff (so a bit harder to read), as interdiff would have marked everything as changed:
Comment #38
klokie CreditAttribution: klokie as a volunteer commentedWouldn't it make more sense to include this functionality with the "metatag_importer" submodule?
Also I needed to change
metatag_metatags_save($entity_type, $entity_id, $revision_id, $data, $langcode);
to
metatag_metatags_save($entity_type, $entity_id, $revision_id, $data, $bundle);
to match the function signature for
metatag_metatags_save()
; otherwise no meta tags were saved on my multilingual site.Comment #39
DamienMcKenna@klokie: Excellent point! Yeah, this does need to be moved to scripts for Metatag Installer.
Comment #40
malcomio CreditAttribution: malcomio as a volunteer and at Capgemini commentedHere's a patch based on #37, taking into account the feedback above.
I haven't written an admin form for it, but it seems to be working OK from the drush command
Comment #41
dandaman CreditAttribution: dandaman commentedTried the latest patch and it did migrate my data. However, it really gave me no indication to if there was actually any data moved. Maybe just a total number of items imported or something could be added? (In the Page Title import, it does include the number of records it would migrate before confirmation--something like that or, when importing, a bit of output that says what or how much was imported.) Just a thought.
Comment #42
dmenefee CreditAttribution: dmenefee commentedQuick question: why do patches -32 and later remove the capability of importing path-based metatags quick data? I need to convert MTQ path-based settings to contexts.
Comment #43
DamienMcKenna@dmenefee: Maybe because Metatag on D8 doesn't have equivalent functionality yet?
Comment #44
DamienMcKennaSkip that, forgot this for D7 not D8.
Comment #45
labboy0276 CreditAttribution: labboy0276 commentedI just used this on 7.x-1.22 and it worked great. We inherited a legacy d7 site that had metatag quick on it. Installed metatag, configured metatag, ran drush mtcmq = q'plah.
Comment #46
DamienMcKennaThanks for all the reviews. Lets see if the patch still applies.
Comment #48
DamienMcKennaAnyone have time to do a quick reroll?
Comment #49
DamienMcKennaI had time, so here's a reroll.
Comment #50
DamienMcKennaComment #51
DamienMcKennaMinor tweaks.
Comment #52
DamienMcKennaFurther improvements, and now it outputs some status messages as it's working.
Comment #54
DamienMcKennaCommitted. Thank you all for your help, I'm glad to finally have this committed.
Also, to @dmenefee - apologies for the snarkiness of my reply in #43, it was unnecessary.
Comment #55
DamienMcKenna