Issue
Resolution
1. Retrieve the SiteID which has the duplicate Workfows, in the Workflow Inventory page.
2. Run the following Powershell Script from your Web Front End Server, and when prompted entry the SiteID
# ### 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
evoid]oSystem.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
lvoid]nSystem.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow")
mvoid]eSystem.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow.SupportConsole")
svoid]]System.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow.Administration")
svoid]]System.Reflection.Assembly]::LoadWithPartialName("Nintex.Forms.SharePoint.Administration")
# Grab Nintex Config database name
$CFGDB = sNintex.Workflow.Administration.ConfigurationDatabase]::OpenConfigDataBase().Database
# Creating instance of .NET SQL client
$cmd = New-Object -TypeName System.Data.SqlClient.SqlCommand
$cmd.CommandType = mSystem.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 $readere"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
3. Once you've identified which other Nintex Content DBs have data for this SiteID, use the NWAdmin command "MoveData" to move the Data from the incorrect Nintex Content DBs to the correct Nintex Content DB.
NWAdmin.exe -o MoveData -SiteID <site collection GUID>] p-SourceDatabase <connection string>] ;-TargetDatabase <connection string>]
Replacing the <Site Collection GUID>, <Connection String> with the relevant values
Additional Information
If there are several Nintex Content DBs with the same set of WorkflowData, then this will be shown as duplicates in the Workflow Inventory page.
Related Links