How to Update Database Mapping for a site

  • 15 February 2022
  • 0 replies
  • 302 views

Userlevel 3
Badge +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.

 


0 replies

Be the first to reply!

Reply