Stefan Goßner

Senior Escalation Engineer for SharePoint (WSS, SPS, MOSS, SP2010) and MCMS

Blogs

How to switch MCMS databases programmatically

  • Comments 2
  • Likes

Today I received the question if it is possible to script the actions of the DCA when changing the MCMS database. This can be extremly useful in developer environments where users develop against different databases.

Actually the DCA cannot be scripted but it is possible to backup and restore the configuration settings the DCA does in the registry. To ensure that no side effects show up (especially with MCMS node cache coming out of sync) it is require to restart all MCMS services while changing the database configuration settings.

The following steps will do the job:

  1. You need to manually configure the database using the DCA.
  2. Then export the following registry key into a .reg file:
    HKEY_LOCAL_MACHINE\SOFTWARE\NCompass\Resolution Content Server\Configuration\0\Local\Database
  3. You need to repeat this for every database to get a reg file for every database configuration (e.g. DB1.reg, DB2.reg, ...)

To switch to another database you now need to do the following:

  • IISRESET /STOP
  • NET STOP AESecurityService
  • REGEDIT /S DBx.reg                              <--- here you need to pass in the registry file for the desired database configuration.
  • NET START AESecurityService
  • IISRESET /START
Comments
  • Isn't this going against your premise of not using undocumented API's(Interfaces)?  Isn't the windows registry hack an undocumented API?

  • Hi Stephen,

    no it is not the same. This hack does not access the database.

    Cheers,
    Stefan

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment