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!

Files: 
CommentFileSizeAuthor
#32 metatag-n1282806-32.patch8.73 KBDamienMcKenna
#31 metatag-import_from_meta_tags_quick-1282806-31.patch8.16 KBvictoriachan
#15 metatag-import_from_meta_tags_quick-1282806-15.patch8.05 KBiamEAP
PASSED: [[SimpleTest]]: [MySQL] 73 pass(es).
[ View ]
#14 metatag-import_from_meta_tags_quick-1282806-14.patch7.98 KBiamEAP
PASSED: [[SimpleTest]]: [MySQL] 15 pass(es).
[ View ]
#12 metatag-import_from_meta_tags_quick-1282806-12.patch3.58 KBiamEAP
PASSED: [[SimpleTest]]: [MySQL] 15 pass(es).
[ View ]
#11 metatag-import_from_meta_tags_quick-1282806-11.patch3.08 KBiamEAP
PASSED: [[SimpleTest]]: [MySQL] 15 pass(es).
[ View ]

Comments

Title:Upgrading from "Meta tags quick 7.x-2.0" to "Metatag"Upgrade path from Meta tags quick
Version:7.x-1.0-alpha1»
Category:support» feature

Agreed that this would be useful!

Subscribe please

@Wellsy Note that there is now a follow button in the top right. No need to comment to subscribe!

Thanks @rickvug. Is that new?

Edit: Just seen the homepage - yes it is new. Nice

@Wellsy Yes, as of yesterday I believe. See http://drupal.org/node/1306444 for the announcement.

Version:» 7.x-1.0-alpha6

Here is code snippet for copy node metatags from metatags_quick to metatag module:

<?php
  $result
=db_query("SELECT node.nid, field_data_meta_description.meta_description_metatags_quick, field_data_meta_keywords.meta_keywords_metatags_quick FROM {node}
  LEFT JOIN {field_data_meta_description} ON (field_data_meta_description.entity_type='node' AND field_data_meta_description.entity_id=node.nid)
  LEFT JOIN {field_data_meta_keywords} ON (field_data_meta_keywords.entity_type='node' AND field_data_meta_keywords.entity_id=node.nid)
  "
);
  foreach(
$result as $row) {
    if(!empty(
$row->meta_description_metatags_quick)) $metatags[$row->nid]['description']['value']=$row->meta_description_metatags_quick;
    if(!empty(
$row->meta_keywords_metatags_quick)) $metatags[$row->nid]['keywords']['value']=$row->meta_keywords_metatags_quick;
  }
  foreach(
$metatags as $id=>$item) {
   
db_merge('metatag')
      ->
key(array(
       
'entity_type' => 'node',
       
'entity_id' => $id,
      ))
      ->
fields(array(
       
'data' => serialize($item),
      ))
      ->
execute();
  }
?>

Title:Upgrade path from Meta tags quickUpgrade path: Meta tags quick
Issue tags:+upgrade path

Component:Documentation» Code
Category:feature» task

Cross linking to #1658970: Upgrade path: Page_Title. For Page Title module migration information.

Status:Active» Needs review
StatusFileSize
new3.08 KB
PASSED: [[SimpleTest]]: [MySQL] 15 pass(es).
[ View ]

Here'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.

StatusFileSize
new3.58 KB
PASSED: [[SimpleTest]]: [MySQL] 15 pass(es).
[ View ]

Adding 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.

Thanks for the updates and patches.

We do make use of path passed meta tags on our site.

StatusFileSize
new7.98 KB
PASSED: [[SimpleTest]]: [MySQL] 15 pass(es).
[ View ]

Here'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.

StatusFileSize
new8.05 KB
PASSED: [[SimpleTest]]: [MySQL] 73 pass(es).
[ View ]

Noticed there was a problem migrating robots fields; Meta Tags expects them in the form array('noindex' => 'noindex'), while the previous patch was feeding it array('noindex').

This patch takes care of that. Otherwise, the same.

Status:Needs review» Needs work

I 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?

Version:7.x-1.0-alpha6» 7.x-1.x-dev

Lets retest it.

Status:Needs work» Needs review

Will 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?

Is the same patch, why we expect different results?

Status:Needs review» Reviewed & tested by the community

Retested on a new clone of our site and the (2) meta types we where using imported properly.

They include Meta Keyword and Meta Description.

Updated -- 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.

Category:task» feature
Status:Reviewed & tested by the community» Needs work

Needs work:

  • Metatag now needs supports the 'REVISIT-AFTER' tag.
  • The page title tag needs to be supported.
  • Does the Metatag module itself need to be listed as a dependency for the task?
  • It must support any entity rather that just nodes.

@DamienMcKenna

This issue has been focused on just the https://drupal.org/project/metatags_quick.

Is your post #26 meant to expand this issue?

Metatag now needs supports the 'REVISIT-AFTER' tag.
The page title tag needs to be supported.

metatags_quick does not support these tags.

Does the Metatag module itself need to be listed as a dependency for the task?
It must support any entity rather that just nodes.

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?

@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:

  • The most recent commit, from May, adds support for the page title via the "Set page title" field formatter.
  • The REVISIT-AFTER meta tag can be created by Metatags_Quick, is supported by Metatag, and there's a commented-out line in the script for it, so it should be supported with this upgrade script.

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

@DamienMcKenna thanks for the detailed reply.

Issue summary:View changes

Sadly 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

I've updated the patch from #15 to include the vid / revision_id data.

Thanks,
Victoria

Component:Code» Integration with other module
StatusFileSize
new8.73 KB

Also for consideration, an update script to migrate the title, description and keywords fields that uses the Fields API to identify which fields to migrate.

While my update script works for a limited use case, the real goal will be available both a drush script and through the website admin.