Showing results for 
Search instead for 
Did you mean: 

"Object not set to an instance of an object" When Running DetachDatabase NWAdmin Command

When running the DetachDatabase NWAdmin command, the operation lists out sites associated with the database, and then the following error occurs:

Command line execution error: Object reference not set to an instance of an object.
  1. Take backup of the Nintex content database being detached.
  2. Run the following query within SQL Management Studio against the Nintex content database being detached to find all SiteIds referenced in the database:
    SELECT DISTINCT CAST(siteid as uniqueidentifier) as SiteID FROM dbo.workflowinstance
  3. Based the SiteIds returned, determine which ID the DetachDatabase command failed on (this will be the first site or SiteId *not* listed out by the DetachDatabase command)
  4. Once the orphaned SiteId is determined, expand open the Nintex content database > Programmability > Stored Procedures
  5. Right-click on the dbo.PurgeWorkflowData stored procedure and select 'Execute Stored Procedure...'
  6. Within the window that appears, check 'Pass Null Value' for all parameters *except* for @siteid
  7. Pass @siteid the GUID of the orphaned site found in step 3, and select OK.
  8. Re-run the DetachDatabase command.
Version history
Revision #:
1 of 1
Last update:
‎12-18-2018 02:58 PM
Updated by: