All Collections
Problem analyzers
Swap the site administrator reference of a new CustomSite
Swap the site administrator reference of a new CustomSite

Avoid deployment errors after adding a new community to your org

David Runciman avatar
Written by David Runciman
Updated over a week ago

This problem analyzer lets you swap the site administrator reference of an
Experience Workspace to match the user specified in the target org.

What triggers this problem analyzer?

Usernames are unique within the Salesforce ecosystem and have a one-to-one association with a specific org. If your org contains an Experience Workspace (also known as a CustomSite), the metadata for the CustomSite will reference the user in the siteAdmin field. The problem analyzer gets triggered because the deployment will fail if the referenced user doesn’t already exist in your target org.

What problem does it solve?

If you attempt to run a deployment without changing the siteAdmin reference of a new CustomSite to a user associated with your target org, the deployment will fail with the following error message: In field: siteAdmin - no User named [email protected] found. 

How does it work?

After you have selected to remove the siteAdmin reference to the user, Gearset modifies the metadata for your CustomSite before deploying it to your target org. 

Source XML example

<CustomSite xmlns="http://soap.sforce.com/2006/04/metadata">
  <siteAdmin>[email protected]</siteAdmin>
</CustomSite>

If the CustomSite already exists in the target, Gearset will swap the siteAdmin for the user already specified in the target org. If your CustomSite is completely new, however, Gearset will swap the siteAdmin for the user that was used to connect the target org to Gearset. It then deploys any modifications to the CustomSite, along with the modified siteAdmin element, to the target. 

Modified XML deployed

<CustomSite xmlns="http://soap.sforce.com/2006/04/metadata">
  <siteAdmin>[email protected]</siteAdmin>
</CustomSite>
Did this answer your question?