Working on a Database refresh in SDL Tridion Sites 8.5


  1. Import Databases
  2. CM DB, Broker DB's, Discovery DB's
  3. Bring down all containers for CIS
  4. Modify Dockerfile (ie Dockerfile.live.discovery) to updated (target) SQL Server DB credentials
  5. Bring back up all CIS


  1. Get-TtmCdEnvironment
  2. Disable-TtmCdEnvironment -Id Preview_CdEnvId
  3. Export TopMan CdStructure
  4. Manually updated json with the Target Discovery endpoints
  5. Import TopMan CdStructure
  6. Set-TtmCmEnvironment
  7. Enable-TtmCdEnvironment -Id Preview_CdEnvId - this is where I get this error
  8. Sync-ttmCdEnvirnonment - get pretty much same error. Which confirms (to myself) I am doing something wrong here..

Then try to run Sync-TtmCdEnvironment and pass any CdEnvId's (i.e. Preview_CdEnvId), I get OAuth Error below, "error":"invalid_grant"}

PS C:\Windows\system32> Sync-TtmCdEnvironment
cmdlet Sync-TtmCdEnvironment at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Id: !?
ID of the CdEnvironment
Id: Preview_CdEnvId
Sync-TtmCdEnvironment : Unable to synchronize item of type 'CdEnvironmentData' with id 'Preview_CdEnvId'.
One or more errors occurred.
An error occurred while processing this request.
At line:1 char:1
+ Sync-TtmCdEnvironment
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (Tridion.Topolog...ironmentCommand:SyncEnvironmentCommand) [Sync-TtmCdEnvironment], DataServiceException
+ FullyQualifiedErrorId : Tridion.TopologyManager.Automation.Cmdlets.SyncEnvironmentCommand

However, I validate in Postman and everything looks good.


<service xmlns="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:metadata="http://docs.oasis-open.org/odata/ns/metadata" xmlns:base="http://server.com:8182/discovery.svc" xmlns:context="http://server.com:8182/discovery.svc/$metadata">
    <collection href="WebApplications">
    <collection href="PublicationMappings">
    <metadata:singleton href="Environment">

Question - is there somewhere in the Sync-TtmCdEnvironment cmdlet that I can pass in the OAuth credentials or how does this work exactly?

UPDATE I - Same thing happens with Enable-TtmCdEnvironment

PS C:\Windows\system32> Enable-TtmCdEnvironment -Id Preview_CdEnvId
Enable-TtmCdEnvironment : One or more errors occurred.
Authorization failed while attempting to communicate with CD Discovery Service 'http://server.com:8182/discovery.svc'. Please make sure the proper credentials have been configured in the CD Environment 'Preview_CdEnvId'.
An error occurred while processing this request.
At line:1 char:1
+ Enable-TtmCdEnvironment -Id Preview_CdEnvId
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (Tridion.Topolog...ironmentCommand:EnableCdEnvironmentCommand) [Enable-TtmCdEnvironment], DataServiceException
+ FullyQualifiedErrorId : Tridion.TopologyManager.Automation.Cmdlets.EnableCdEnvironmentCommand

UPDATE II - for Velmurugan answer below.

EnvironmentPurpose   : Preview
DiscoveryEndpointUrl : http://server.<hidden>.com:8182/discovery.svc
Credentials          : "AuthenticationType":"OAuth", "ClientId":"cmuser", "ClientSecret":"********"
IsOffline            : True
ScopedRepositoryKeys : {}
Id                   : Preview_CdEnvId
ExtensionProperties  : {}


Riddle me this - I am able to Set-TtmCdEnvironment successfully with DS - So I am able to validate that it is indeed able authenticate with OAuth from same environment, same env purpose, etc., but when I try to enable or synch environment, returns same OAuth response as it is invalid. {"error":"invalid_grant"}

enter image description here

  • Is it your setup has multiple Topology Manager instances running side by side?
    – Velmurugan
    Sep 10, 2018 at 9:22
  • working on db refresh to lower environment, not scaled out environment. So I need to export/import TopMan but just trying to figure out a data refresh would work.. Sep 10, 2018 at 15:10

1 Answer 1


CMEnvironmentId needs to be the same across all scaled out instances. Even if their roles are different like the coreservice, publisher, workflow agent. The CMEnvironmentId is kept the same using the database name and DB server name.

Double check the TRIDION_CM_ENVIRONMENT_ID and Get-TtmCmEnvironment cmdlet to check the CoreServiceCredentials details and modify by Set-TtmCmEnvironment

Also double check your DiscoveryEndpointUrl Credentials are used correctly cmuser and credentials by Get-TtmCdEnvironment cmdlet

I hope it helps.

  • I have the updated my question with the Get-TtmCdEnvironment response for Preview_CdEnvId - which is a CdEnvId I chose to do this.. same behaviour for all exist. I am just isolating. Sep 13, 2018 at 15:08
  • 1
    Try with verbose enabled to capture the error details by running this cmdlet Enable-TtmCdEnvironment -Verbose -Id Preview_CdEnvId and then also once again double check the discovery service config cd_ambient_conf.xml for cmuser credentials, because while setting with Set-TtmCmEnvironment cmdlets it's really not validating only validating by running the Enable-TtmCdEnvironment
    – Velmurugan
    Sep 13, 2018 at 19:02
  • Thanks. I was able to find error in the cis services.. fixed and all cmdlts work and able to publish!! woohoo! Sep 13, 2018 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.