Index: quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/Extensions/Install.py
===================================================================
--- quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/Extensions/Install.py	(revision 2246)
+++ quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/Extensions/Install.py	(revision 2376)
@@ -1,3 +1,4 @@
 from Products.CMFCore.utils import getToolByName
+from Products.GenericSetup.upgrade import _upgrade_registry
 
 PROFILE = "profile-quintagroup.plonegooglesitemaps:default"
@@ -9,6 +10,23 @@
     mtool = getToolByName(self, 'portal_migration')
     plone_version = mtool.getFileSystemVersion()
+    isPlone3 = plone_version.startswith('3')
+    isPlone4 = plone_version.startswith('4')
 
-    if plone_version.startswith('3'):
+    if reinstall and (isPlone3 or isPlone4):
+        step = None
+        profile_id = 'quintagroup.plonegooglesitemaps:default'
+        steps_to_run = [s['id'] for s in setup_tool.listUpgrades(profile_id, show_old=False)]
+        for step_id in steps_to_run:
+            step = _upgrade_registry.getUpgradeStep(profile_id, step_id)
+            step.doStep(setup_tool)
+            msg = "Ran upgrade step %s for profile %s" % (step.title, profile_id)
+            logger.log(logging.INFO, msg)
+        # We update the profile version to the last one we have reached
+        # with running an upgrade step.
+        if step and step.dest is not None and step.checker is None:
+           setup_tool.setLastVersionForProfile(profile_id, step.dest)
+        return "Ran all reinstall steps."
+
+    if (isPlone3 or isPlone4):
         # if this is plone 3.x
         (ps.aq_base).__of__(self).runAllImportStepsFromProfile(PROFILE)
Index: quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/configure.zcml
===================================================================
--- quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/configure.zcml	(revision 2246)
+++ quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/configure.zcml	(revision 2376)
@@ -26,4 +26,22 @@
       />
 
+  <genericsetup:upgradeStep
+      title="Upgrade Plone Google Sitemaps"
+      description="Upgrade quintagroup.plonegooglesitemaps 1.0 to 1.1"
+      source="*"
+      destination="1.1"
+      handler=".upgrades.upgrade_1_0_to_1_1"
+      sortkey="1"
+      profile="quintagroup.seoptimizer:default" />
+
+  <genericsetup:upgradeStep
+      title="Upgrade Plone Google Sitemaps"
+      description="Upgrade quintagroup.plonegooglesitemaps 1.1 to 1.2"
+      source="*"
+      destination="1.2"
+      handler=".upgrades.upgrade_1_1_to_1_2"
+      sortkey="2"
+      profile="quintagroup.seoptimizer:default" />
+
     <!-- -*- extra stuff goes here -*- -->
 
Index: quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/upgrade_1_0_to_1_1/catalog.xml
===================================================================
--- quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/upgrade_1_0_to_1_1/catalog.xml	(revision 2376)
+++ quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/upgrade_1_0_to_1_1/catalog.xml	(revision 2376)
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<object name="portal_catalog" meta_type="Plone Catalog Tool">
+ <column value="canonical_path" />
+</object>
+
+
Index: quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/upgrade_1_0_to_1_1/metadata.xml
===================================================================
--- quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/upgrade_1_0_to_1_1/metadata.xml	(revision 2376)
+++ quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/upgrade_1_0_to_1_1/metadata.xml	(revision 2376)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<metadata>
+  <version>1.1</version>
+</metadata>
Index: quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/upgrade_1_1_to_1_2/catalog.xml
===================================================================
--- quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/upgrade_1_1_to_1_2/catalog.xml	(revision 2376)
+++ quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/upgrade_1_1_to_1_2/catalog.xml	(revision 2376)
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<object name="portal_catalog" meta_type="Plone Catalog Tool">
+ <column value="canonical_path" remove="True" />
+ <column value="canonical_link" update="True" />
+</object>
+
+
Index: quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/upgrade_1_1_to_1_2/metadata.xml
===================================================================
--- quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/upgrade_1_1_to_1_2/metadata.xml	(revision 2376)
+++ quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/profiles/upgrade_1_1_to_1_2/metadata.xml	(revision 2376)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<metadata>
+  <version>1.2</version>
+</metadata>
Index: quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/upgrades.py
===================================================================
--- quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/upgrades.py	(revision 2376)
+++ quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/upgrades.py	(revision 2376)
@@ -0,0 +1,46 @@
+import logging
+from zope.component import queryMultiAdapter
+
+from quintagroup.canonicalpath.upgrades import CanonicalConvertor
+
+logger = logging.getLogger('quintagroup.plonegooglesitemaps')
+
+convertor = None
+
+def migrateCanonical(plone_tools):
+    """ Rename qSEO_canonical property into PROPERTY_LINK
+        for all portal objects, which use SEO
+    """
+    global convertor
+    types = plone_tools.types()
+    purl = plone_tools.url()
+    allCTTypes = types.listContentTypes()
+    obj_metatypes =  [m.content_meta_type for m in types.objectValues() \
+                      if m.getId() in allCTTypes] 
+   convertor = CanonicalConvertor(portal_url=purl())
+   portal.ZopeFindAndApply(
+                            portal,
+                            obj_metatypes=','.join(obj_metatypes),
+                            apply_func=renameProperty
+                            )
+    print convertor.getLog()
+
+def renameProperty(obj, path):
+    """ Migrate canonical_path property into canonical_link
+        for obj, which use SEO
+    """
+    if convertor is not None:
+        convertor.convertIPathToLink(obj)
+
+def upgrade_1_0_to_1_1(setuptool):
+    """ Upgrade quintagroup.plonegooglesitemaps from version 1.0 to 1.1.
+    """
+    setuptool.runAllImportStepsFromProfile('profile-quintagroup.plonegooglesitemaps:upgrade_1_0_to_1_1')
+
+
+def upgrade_1_1_to_1_2(setuptool):
+    """ Upgrade quintagroup.plonegooglesitemaps from version 1.1 to 1.2.
+    """
+    plone_tools = queryMultiAdapter((setuptool, setuptool.REQUEST), name="plone_tools")
+    migrateCanonical(plone_tools)
+    setuptool.runAllImportStepsFromProfile('profile-quintagroup.plonegooglesitemaps:upgrade_1_1_to_1_2')
