![The connection control to switch between environments](_images/aeh-org-switcher.png)
Working With Sandboxes
Use Salesforce sandbox organizations to test your portal in a sandbox environment under the same conditions as your production environment. With API Experience Hub, you can manage separate deployment environments for your API portal. You can connect to multiple Salesforce sandbox organizations and switch between them. Manage Salesforce organizations from the Manage your API portal page by selecting sandbox environments that are available in the current Salesforce connection.
Before You Begin
Ensure that you have sandbox organizations already set up. For more information about creating sandboxes, see Create a Sandbox in the Salesforce documentation.
Manage Salesforce Organization Connections
-
In the Manage your API portal page, click the connection control.
-
Select an option:
-
To connect to a production organization, click Connect production org from the Connected Salesforce Orgs dialog.
The connection process restarts and you can to connect to the production organization.
-
To switch to another a sandbox for the connected production organization, click Switch to this org from the Connected Salesforce Orgs dialog.
-
To connect to a sandbox organization that isn’t connected, click Connect.
The connection process restarts and you can connect to the sandbox organization.
-
To connect to a new sandbox organization, click Connect new sandbox org.
The connection process restarts and you can connect to the new sandbox organization.
-
To switch to another sandbox organization, click Switch to this org.
-
Manage Orphaned Sandboxes
Orphan sandboxes occur when you disconnect a production organization and child sandbox organizations are still connected. If you connect to a sandbox that isn’t a child of the production organization, the sandbox appears in the More sandbox orgs section of the Connected Salesforce Organizations dialog. You can still switch to this sandbox. A sandbox no longer appears as an orphan when you reconnect to the associated production organization.
Manage Refreshed Sandbox Connections
Refreshing a sandbox updates the metadata from the source organization. If a sandbox refreshes after the production organization is connected, reconnect to switch to this sandbox.
If a sandbox refreshes before the production organization is connected, switch to this sandbox without.
Delete Sandbox Organizations
To delete a sandbox organizaton, see Delete a sandbox in the Salesforce documentation.
Promoting a Sandbox to Production
After testing a portal in a sandbox environment and it’s is ready for production, deploy a subset of the Salesforce metadata using your CI/CD pipeline to production. Afterward, connect to the production instance with the subset of the Salesforce metadata to complete the installation and start curating APIs.
Before You Begin
Ensure you have basic knowledge of the following:
-
Version control systems (VCS), for example, Git
-
CI/CD pipeline concepts
-
API portal created in a sandbox environment
Promote a Sandbox to Production
Move the portal’s styling and customizations from the sandbox organization to the production organization:
-
Create a Git repository to store the API Experience Hub metadata:
-
Clone it locally to your machine.
-
Create a manifest
package.xml
file in./manifest
, for example:Details
<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>homeroCompanyLogo</members> <members>homeroLoginBackground</members> <members>minionHomeBanner</members> <members>minionPageBanner</members> <name>ContentAsset</name> </types> <types> <members>API_Experience_Hub1_banner</members> <members>API_Experience_Hub1_logo</members> <name>StaticResource</name> </types> <types> <members>AEH</members> <members>AEH/API_Experience_Hub1_logo</members> <name>Document</name> </types> <types> <members>AEH</members> <members>AEH/ChangedPasswordEmailTemplate</members> <members>AEH/ForgotPasswordEmailTemplate</members> <members>AEH/NewMemberWelcomeEmailTemplate</members> <members>AEH/RejectedMemberEmailTemplate</members> <name>EmailTemplate</name> </types> <types> <members>AEHLetterhead</members> <name>Letterhead</name> </types> <types> <members>Anypoint</members> <members>AnypointDevx</members> <members>AnypointEu</members> <members>AnypointQax</members> <members>AnypointStgx</members> <members>ExchangeAssetIcons</members> <members>ExchangeAssetIconsDevx</members> <members>ExchangeAssetIconsEu</members> <members>ExchangeAssetIconsQax</members> <members>ExchangeAssetIconsStgx</members> <members>GStaticFonts</members> <members>GoogleFonts</members> <members>SegmentAPI</members> <members>SegmentCDN</members> <name>CspTrustedSite</name> </types> <types> <members>Anypoint</members> <members>AnypointDevx</members> <members>AnypointEu</members> <members>AnypointQax</members> <members>AnypointStgx</members> <members>ExchangeAssetIcons</members> <members>ExchangeAssetIconsDevx</members> <members>ExchangeAssetIconsEu</members> <members>ExchangeAssetIconsQax</members> <members>ExchangeAssetIconsStgx</members> <members>SegmentAPI</members> <name>RemoteSiteSetting</name> </types> <!-- <types> <members>ExperienceBundle</members> <members>Communities</members> <name>Settings</name> </types> --> <types> <members>API_Experience_Hub_Manage_Networks</members> <name>PermissionSet</name> </types> <types> <members>API Experience Hub</members> <name>Network</name> </types> <types> <members>HTTP_API_Audience</members> <name>Audience</name> </types> <types> <members>API_Experience_Hub</members> <name>CustomSite</name> </types> <types> <members>API_Experience_Hub1</members> <name>ExperienceBundle</name> </types> <types> <members>AEH_Default_Navigation</members> <members>AEH_Default_User_Navigation</members> <name>NavigationMenu</name> </types> <types> <members>cbAPI_Experience_Hub</members> <name>NetworkBranding</name> </types> <!-- <types> <members>API Experience Hub Member User</members> <name>Profile</name> </types> --> <version>60.0</version> </Package>
-
In a VCS, create a development branch.
-
Download the metadata using the manifest created from the Salesforce sandbox organization.
-
Retrieve the metadata from the Salesforce sandbox organization using Salesforce CLI commands:
-
Log in to the Salesforce sandbox organization:
sf auth web login --instance-url=https://<SANBOX-INSTANCE_URL> --alias sandboxOrg
-
Edit the
manifest/package.xml
file before retrieving the metadata from the sandbox organization.Your sandbox organization can contain metadata from multiple products because it’s a copy of the Salesforce production organization. API Experience Hub is a subset of the sandbox organization specified in the
manifest/package.xml
file created when you created the Git repository in a previous step. -
If the portal contains branding images, add them in the
ContentAsset
section of themanifest/package.xml
. For example:... <types> <members>homeroCompanyLogo</members> <members>homeroLoginBackground</members> <members>minionHomeBanner</members> <members>minionPageBanner</members> <name>ContentAsset</name> </types> ...
-
Review the metadata and retrieve it by running this command:
sf project retrieve start --manifest ./manifest/package.xml --target-org sandboxOrg
-
Confirm the metadata and commit all the metadata changes into the Git repository, or modify the
manifest/package.xml
and repeat the process if some metadata is missing or unnecessary.
-
-
Move the API Experience Hub portal from the sandbox organization to the production organization:
-
Log in to the production organization:
sf auth web login --instance-url=https://<ENTERPRISE-INSTANCE_URL> --alias productionOrg
Before installing the API Experience Hub Manage package in your production organization, get the managed package version ID from the
SubscriberPackageVersionId
field that’s installed in the sandbox organization. -
Run the following command to get the managed package version ID. The
SubscriberPackageVersionId
field from the API Experience Hub managed package begins with04t
:sf package installed list --target-org sandboxOrg --json
-
Install the API Experience Hub managed package in the production organization:
sf package install --package 04t... --target-org productionOrg --no-prompt --wait 30
-
Deploy the API Experience Hub metadata to the production organization using Jenkins or other CI/CD tools, for example:
sf project deploy start --source-dir force-app --target-org productionOrg
All configurations deploy in the production organization and you’re ready to connect this organization with API Experience Hub.
-
-
Configure API Experience Hub in the production organization:
-
Navigate to Anypoint Platform, enter your username and password, and click Sign in.
-
From Anypoint Platform, select API Experience Hub.
-
Connect the Salesforce production organization (Enterprise organization).
-
Click Use existing portal to reuse the portal that already exists.
-
From the API management page, add assets to the portal.
-
Click Preview and publish your portal to preview the portal, and then click Publish.
-