Skip to main content
Search Again

We think these articles could help you:

    See More
    Nintex Knowledge Base

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

    Summary
    When running the DetachDatabase NWAdmin command, the operation lists out sites associated with the database then errors with "Command line execution error: Object reference not set to an instance of an object."

    Solution
    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:
      1. 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, this will now run without issue and prompt you to continue the detach process.