The Variations Fixup Tool has been integrated into stsadm.exe to allow administrators to fix common variation problems, which are caused by inconsistencies between the actual site structure and the data stored in the relationships list. This article will

  • explain the different operation modes of the variations fixup tool
  • allow you to understand which type of problems can be fixed using the tool

 

Usage

The Variations Fixup Tool has been integrated into stsadm.exe to allow administrators to fix common variation problems, which are caused by inconsistencies between the actual site structure and the data stored in the relationships list.

The tool has four different operation modes:

  • Scan - This operation mode can be used to analyze the variations hierarchy and report identified problems

    This parameter provides functionality that cannot be accessed using the Central Administration Web site.

  • Fix - Corrects identified problems. If the recurse parameter is used, fixes are done recursively for all sub-sites

    This parameter provides functionality that cannot be accessed using the Central Administration Web site.

  • Spawn - This operation mode creates new variations for a site in the source variation label specified by the URL parameter. New peers are created for either all or one specific target variations label. If the recurse parameter is used, variations for sub-sites and pages are also created

    This operation mode is equivalent to the New Variation Site user interface setting that is located on the Site Content and Structure page.

  • ShowRunningJobs - Displays current status of Variations Propagate Page Job Definition and Variations Propagate Site Job Definition timer jobs that are located on the Timer Job Status page of the SharePoint Central Administration Web site

 

The command supports the following parameters to configure these operation modes:

  • URL - The URL of a site in the source variation label where variations system data is being analyzed or corrected. This parameter is required for all operation modes
  • Label - the variation label to operate on. This parameter is supported by the following operation modes: Scan, Fix, Spawn
  • Recurse - whether to perform the operation recursively or not. This parameter is supported by the following operation modes: Scan, Fix, Spawn

 

The command syntax is as follows:

stsadm -o variationsfixuptool
          -url <absolute web URL> 
         [-fix] 
         [-scan] 
         [-spawn] 
         [-showrunningjobs] 
         [-recurse] 
         [-label <label to fix or spawn>]

 

The different operation modes

In order to use the command correctly it is important to understand what the different operation modes do.

 

ShowRunningJobs

This command enumerates all running jobs for all the automatic propagation jobs for sites and pages:

  • Variations Propagate Page Job Definition
  • Variations Propagate Site Job Definition

This command will not report any of the other "manual" variation jobs:

  • Variations Create Hierarchies Job Definition
  • Variations Create Page Job Definition
  • Variations Create Site Job Definition

Scan

This command analyzes sites and pages in the variation source hierarchy.

For each Site/Page, it reports:

  • If the source site is marked as being in the source variation hierarchy (SPWeb.AllProperties["__InSourceHierarchy"] == True ?). If the site is marked as being in the source hierarchy means that the page is part of the source hierarchy. 
  • The Variation Group Id of the source site or page
    (SPWeb.AllProperties["Variation Group Id"] or PublishingPage.ListItem[FieldId.VariationGroupId])
  • Which peers are registered in the relationships list with same Variation Group Id
  • If a variation peer exists in the configured labels (default is all spawned labels) by first checking if a peer is configured in the relationships list with the same variation group ID for the given label. If no peer can be found using the relationships list we try to lookup the peer using the default URL that would be used when creating a variant in the given label
  • The variation group id of the variation peers in the target labels (SPWeb.AllProperties["Variation Group Id"] or PublishingPage.ListItem[FieldId.VariationGroupId])
  • If the source site/page is configured in the relationships list

In addition the command reports the variation labels used for the peer check (default is all spawned labels).

The tool will not identify any issues - it is required to analyze the report in detail and interpret it in order to find problems.

 

Fix

This operation mode invokes the same method as the Scan operation mode but beside analyzing and reporting the issues it will invoke fix routines for sites and pages.

It is important to understand which types of issues are fixed and which are not.

The following issues are automatically fixed:

  • Missing Variation Group ID on source site or source page
  • Missing relationships list entry for source or target page or site
  • Missing Variation Group ID on target site or target page
  • Different Variation Group ID in source site/page and target site/page (source ID will win)

Any other problem in the variation hierarchy is not fixed by this operation mode. E.g. fix mode will not create missing variation peers.

 

Spawn

This operation mode allows spawning an existing site in the source label to one or all spawned target labels. The operation mode is similar to the New Variation Site option available in Site Content and Structure.

 

Be aware that this operation mode cannot be used to spawn pages in already spawned sites. In case that page variations are missing you cannot use the variations fixup tool to recreate them. You have to manually create/recreate them using the UI.

 

The command initiates the site spawn operation by creating a scheduled work item for the SpawnSiteJobDefinition timerjob. The spawn will be performed as soon as the timerjob runs.

The difference between the scheduled work item created by the CPVAreaEventReceiver and the Variationsfixuptool is that the tool has the option to create a workitem, which only spawns the site to one specific variation rather than to all spawned variation labels.

A common use scenario is to configure the source variation label with the Hierarchy Creation option to create only the root site and not the complete hierarchy and later to spawn the hierarchy or parts of the hierarchy from the source label using the STSADM command.

In MOSS 2007, this command was a major benefit compared to the automatic hierarchy creation in the UI, as it was the only way to force the creation in OWSTIMER rather than W3WP.

With SharePoint 2010 where all actions are already in OWSTIMER the benefit of using the STSADM command rather than the UI is rather limited.

 

Summary

The variations fixup tool allows to create a report (-Scan) about all items in the source label including their variation group id, whether they have a reference in the relationships list and all peer pages with the same variation group id in the configured labels. The tool will not automatically report problems but requires an engineer to analyze the report and identify issues bases on his experiences.

The tool also allows to report which site and page propagation jobs are running (-ShowRunningJobs) when the command is executed and the status the job is in. On the other hand, the tool does not report anything regarding the other variation timer jobs (create hierarchy, create site, create page).

The tool allows to fix issues related to inconsistencies between items in the source and target site and the relationships list (-Fix).

On the other hand, this command will not fix any other types of inconsistencies - e.g. missing items in the source or target label.

The tool also allows to spawn a site or a site hierarchy including the pages from the source to either all spawned target labels or a specific target label by creating a scheduled work item for the SpawnSiteJobDefinition timer job.