Refreshing a Salesforce Sandbox
Take care when refreshing a Sandbox org
A full Salesforce sandbox refresh creates a new Org ID, so Guard cannot re-link the existing connection. Plan before refresh to reduce instability and configuration loss.
Before the refresh
Export or document your policies
Record policy name, scope, rules and notification settings
Use
guard get baseline-policyandguard get policy-intentto capture definitions programmatically using the Guard CLI
Export any historical data you need to retain
Note the Guard connection details
Org display name, purpose, enabled features, connection type (OAuth vs External Client App)
Login URL and connected user
Do not delete the Guard org entry yet
Deletion is irreversible for Guard-held data
Keep the entry until you are ready to reconnect
During the refresh
Complete the Salesforce sandbox refresh as normal. Expect a new Salesforce Org ID when the refresh finishes.
After the refresh: reconnecting in Guard
Step 1 — Wait before making changes
Allow 15–30 minutes after the Salesforce refresh completes before modifying Guard connections. This gives async cleanup and sync jobs time to settle if a prior delete was attempted.
Step 2 — Choose your path
Token expired only, same Org ID
Use Reauthenticate on the org detail page
Full sandbox refresh (new Org ID)
Delete old entry, then register refreshed sandbox
Unsure
Check Salesforce Setup → Company Information for the Org ID. If it changed, you must delete and re-add
Step 3 — Delete the old Guard entry (if Org ID changed)
Open Salesforce Orgs → select the pre-refresh org
Review the delete warning and confirm you have documented policies
Click Delete Org
Wait for the success toast before proceeding
Step 4 — Register the refreshed sandbox
Add a new Salesforce org connection with the same display name and purpose as before
Complete OAuth or External Client App authentication against the refreshed sandbox
Enable the same Guard features (Change Monitoring, Permission Explorer, etc.)
Step 5 — Recreate configuration
Authorization policies
Recreate manually, or via Guard CLI admin baseline-policy create
Change Monitoring notification rules
Recreate, or apply from template
Permission Explorer queries
Recreate saved queries
What cannot be transferred today
Change Monitoring historical records
Authorization Policy violation history
Classification analysis history
Any other data tied to the pre-refresh Guard identification
Policies can be recreated with the same rules, but they are new objects linked to the new Guard identification.
Reducing post-refresh instability
Avoid deleting and immediately re-adding multiple orgs in quick succession
Complete one org reconnect before starting the next
If the Salesforce Orgs page hangs, wait 30 minutes and retry
Ensure only one admin performs the delete/re-add
Last updated
Was this helpful?

