Skip to main content
Nintex Community Menu Bar

How to Update Database Mapping for a site

  • February 15, 2022
  • 0 replies
  • 484 views

Forum|alt.badge.img+8

Topic

How to update a database mapping to a site

 

Instructions

1. First retrieve the Site ID for affected site. You can use the following PowerShell command to retrieve the SiteID by URL, replacing "http://[siteCollectionURL]" with the URL to the site.
 
Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
$siteCollectionURL = "http://[siteCollectionURL]"
$siteCollection = Get-SPSite -Identity $siteCollectionURL
$siteCollection.ID 
 
2. Then run the following SQL query on the Nintex Configuration database:
 
select DB .DatabaseID, DatabaseName, SiteID, ServerName from Databases DB
right join Storage ST on st. DatabaseID = db. DatabaseID

 
3. This will retrieve all the sites that are mapped to a Nintex Content database, make a note of the correct Database ID that site should be mapped to.
 
4 .Finally, execute the following stored procedure on the Nintex Configuration database, replacing with the DatabaseID (AAA) with the one found in the previous step, and the SiteID (BBB) with the one found in the first step.
EXEC @return_value = [dbo].[UpdateStorage]
@DatabaseId = AAA,  --Database ID from step 2
@SiteId = BBB  --Site ID from step 1

5. Then run the SQL query from step 2 again, to verify that the site is now mapped to the correct Nintex Content database.