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

rickvug’s picture

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
mgifford’s picture

Agreed that this would be useful!

Wellsy’s picture

Subscribe please

rickvug’s picture

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

Wellsy’s picture

Thanks @rickvug. Is that new?

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

rickvug’s picture

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

Murz’s picture

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();
  }
?>
DamienMcKenna’s picture

Title:Upgrade path from Meta tags quick» Upgrade path: Meta tags quick
Issue tags:+upgrade path
DamienMcKenna’s picture

Component:Documentation» Code
Category:feature» task
HyperGlide’s picture

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

iamEAP’s picture

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.

iamEAP’s picture

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.

HyperGlide’s picture

Thanks for the updates and patches.

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

iamEAP’s picture

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.

iamEAP’s picture

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.

HyperGlide’s picture

HyperGlide’s picture

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?

DamienMcKenna’s picture

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

Lets retest it.

DamienMcKenna’s picture

Status:Needs work» Needs review
DamienMcKenna’s picture

HyperGlide’s picture

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?

HyperGlide’s picture

Is the same patch, why we expect different results?

HyperGlide’s picture

HyperGlide’s picture

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.

HyperGlide’s picture

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.

DamienMcKenna’s picture

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.
HyperGlide’s picture

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

DamienMcKenna’s picture

@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

HyperGlide’s picture

@DamienMcKenna thanks for the detailed reply.

victoriachan’s picture

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

victoriachan’s picture

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

Thanks,
Victoria

DamienMcKenna’s picture

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.

DamienMcKenna’s picture

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.

DamienMcKenna’s picture

Component:Integration with other module» Importing/migrating data