Duplicate entries of workflows
After the upgrade the workflow inventory may display duplicate entries of workflows.
Cause
After attaching a Nintex content database from another farm there maybe duplicate entries in the Workflow Inventory.
The Nintex Workflow Inventory page queries all of the Nintex content databases in the farm for any records that match the current Site ID. If there are several Nintex content databases with the same set of WorkflowData, then this will be shown as duplicates.
Resolution
Do the following:
- Retrieve the Site ID which has the duplicate workflows.
- Run the following PowerShell Script from your Web Front End Server, and when prompted enter the Site ID.
##########################################################################################
# ### Nintex Workflow Statistics Query ###
#
# This script will use the Nintex Assembilies to query the Nintex databases for the total number of rows in the workflows with a specific SiteID, in the Nintex Content DB
# Prompts for the SiteID
#
#
# Please ensure you run this script as Administrative account that has rights to each Nintex database
#
###########################################################################################
#Adding SharePoint Powershell Snapin
Add-PSSnapin Microsoft.SharePoint.PowerShell -EA silentlycontinue
# The Line below will suppress error messages, uncomment if you are seeing errors but still receiving results.
#$ErrorAction = 'silentlycontinue'
# Loading SharePoint and Nintex Objects into the PS session
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[void][System.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow")
[void][System.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow.SupportConsole")
[void][System.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow.Administration")
[void][System.Reflection.Assembly]::LoadWithPartialName("Nintex.Forms.SharePoint.Administration")
# Grab Nintex Config database name
$CFGDB = [Nintex.Workflow.Administration.ConfigurationDatabase]::OpenConfigDataBase().Database
# Creating instance of .NET SQL client
$cmd = New-Object -TypeName System.Data.SqlClient.SqlCommand
$cmd.CommandType = [System.Data.CommandType]::Text
# Begin SQL Query
cls
$siteid = Read-host -prompt "Enter Site ID"
$cmd.CommandText = "SELECT
count(*) AS 'WFinstance' from workflows
where siteid ='$siteid';"
$indexes = @()
# Call to find all Nintex Content Databases in the Nintex Configuration Database, then execute the above query against each.
foreach ($database in [Nintex.Workflow.Administration.ConfigurationDatabase]::GetConfigurationDatabase().ContentDatabases)
{
$reader = $database.ExecuteReader($cmd)
# Creating a table
while($reader.Read())
{
$row = New-Object System.Object
#Adding Query results to table object
$row | Add-Member -MemberType NoteProperty -Name "Rows in Workflow progres table " -Value $reader["WFinstance"]
$row | Add-Member -MemberType NoteProperty -Name "NTXDB" -Value $database.SqlConnectionString.InitialCatalog
$indexes += $row
}
}
cls
#Print results on screen
$indexes | FT -autosize
Write-host "Total Nintex Content DataBases:" $indexes.Count
- After you have identified the other Nintex content databases have data for the Site ID, use the following command to move the data from the incorrect Nintex content database to the correct one:
Note: Replace the <Site Collection GUID> and <Connection String> in the command with the relevant values.
NWAdmin.exe -o MoveData -SiteID <site collection GUID>] [-SourceDatabase <connection string>] [-TargetDatabase <connection string>]