> For the complete documentation index, see [llms.txt](https://docs.flosum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flosum.com/sandbox-management/sandboxes/refreshing-a-sandbox.md).

# Refreshing a Sandbox

## ![](https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2F6B2NEvLIqTPIjxRAb5oF%2FSummary2-Small-Icon.svg?alt=media\&token=b06e08da-3f2a-4100-88aa-8fcc17033b56) Overview

This article explains how to refresh a sandbox in Sandbox Management and reconnect it to your tenant. Refreshing a sandbox replaces it with a new copy of its source organization, so you can start again from the current state of production.

You can refresh a sandbox with or without a template, and the process is the same either way. A template only adds its steps, which run after you reconnect the sandbox. This article uses a template with the **Data Migration** and **Connect to Flosum Topology** steps enabled.

Sandbox Management uses Salesforce's standard refresh process. Salesforce creates the refreshed sandbox as a new Salesforce org with a new Org ID, so you connect it to your tenant again after the refresh. The sandbox keeps its organization in Global Settings, and then the template's steps run, if you selected a template.

{% hint style="info" %}

#### Before You Begin

The sandbox must be in Sandbox Management, and the organization you copy must have the Sandbox Management app assigned. To add an existing sandbox or a production organization, see the following article.

* [Adding Organizations to Sandbox Management](/sandbox-management/getting-started/adding-organizations-to-sandbox-management.md)

To use a template, create it before you refresh the sandbox. To learn how, see the following article.

* [Creating a Template](/sandbox-management/templates/creating-a-template.md)
  {% endhint %}

## Refreshing a Sandbox in Sandbox Management

{% stepper %}
{% step %}

### Open the Refresh Sandbox Dialog

1. Click **Sandboxes** from the left sidebar menu.
2. Click the sandbox you want to refresh.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FPjWC4mytqiz9XLMMLdT1%2FRefreshingASandbox-01.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>
3. Click **Run Refresh**.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2F0aMvfEs781DmgnvIyfSe%2FRefreshingASandbox-02.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}

#### Refresh Interval

Salesforce limits how often you can refresh a sandbox: once a day for Developer and Developer Pro sandboxes, every 5 days for Partial sandboxes, and every 29 days for Full sandboxes. The sandbox's **Next available** time shows when you can refresh it again, and **Run Refresh** is unavailable until then.
{% endhint %}
{% endstep %}

{% step %}

### Enter the Refresh Details

1. (Optional) Enter a new **Name** to rename the sandbox. The field shows the sandbox's current name.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FJkJpyo9bxlUucj1zoYXZ%2FRefreshingASandbox-03.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>

{% hint style="info" %}

#### Sandbox Names

A sandbox name can contain only letters and numbers, can't start with a number, and can be up to 10 characters long.
{% endhint %}

2. Click the **Source organization** dropdown menu.
3. Select the organization to copy.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FJrwHZGoiL8eFzdPyqIO6%2FRefreshingASandbox-04.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>

{% hint style="info" %}

#### Using a Sandbox as the Source

If you select a sandbox as the **Source organization**, Salesforce clones that sandbox. A cloned sandbox keeps the source sandbox's type, so you can't change the **Sandbox type**, and the **Sandbox access** field isn't available.
{% endhint %}

4. Click the **Sandbox type** dropdown menu.
5. Select the sandbox type. The sandbox's current type is selected.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FX3g1LXthwCcSxJJxPzwF%2FRefreshingASandbox-05.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>

{% hint style="info" %}

#### Changing the Sandbox Type

You can refresh a sandbox as a different type, for example, from **Developer** to **Developer Pro**. Each sandbox type uses one of your Salesforce org's sandbox licenses, so select a type that your Salesforce org has an available license for.
{% endhint %}

6. Click the **Sandbox access** dropdown menu.
7. Select the public group whose members can access the sandbox. The list shows the public groups in the source organization. To create a public group for sandbox access, see [Determine Who Has Sandbox Access](https://help.salesforce.com/s/articleView?id=sf.data_sandbox_selective_access.htm\&type=5) in Salesforce Help.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FICvSAlVmKW8BuPpjpAIO%2FRefreshingASandbox-06.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>
8. (Optional) Click the **Apex Class** dropdown menu and select an Apex class to run after the sandbox is refreshed. The class must implement Salesforce's `SandboxPostCopy` interface. The list shows every Apex class in the source organization, and a class that doesn't implement the interface doesn't run.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FMQcRBAp6Y2KvziwwQZHj%2FRefreshingASandbox-07.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>
9. (Optional) Click the **Template** dropdown menu and select the template to apply.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FFA7WBRGKjoAHCGvBtEKs%2FRefreshingASandbox-08.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>
10. If you selected a template, review its steps in the **Preview** panel.

{% hint style="warning" %}

#### A Refresh Can't Be Undone

Refreshing replaces the sandbox with a new copy of the source organization. All records, metadata changes, and scheduled jobs in the sandbox that aren't deployed to production are lost.

Connecting the refreshed sandbox also permanently deletes the Backup & Archive, Data Migrator, and Audit & Compliance data stored for the sandbox's organization in your tenant.
{% endhint %}

11. Click **Refresh**.

    <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FwurXinbiektw1hKTOuDd%2FRefreshingASandbox-09.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Monitor the Refresh

The **Sandboxes** list doesn't update on its own, so you need to refresh it to see the sandbox's progress.

{% hint style="info" %}

#### Refresh Time

A refresh can take from several minutes to several days, depending on the size of your Salesforce org and the sandbox type.
{% endhint %}

1. The sandbox's status changes to **Refreshing**. Click **Sandboxes** from the left sidebar menu.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2Fyu6Tda0oTLOPQKBXNvyt%2FRefreshingASandbox-10.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>
2. Click the refresh icon to the right of the search bar to update the list.
3. While Salesforce is refreshing the sandbox, its **Status** shows **Refreshing** and its progress.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2F8ZugIoejdg8BrUALoJeB%2FRefreshingASandbox-11.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>
4. When the **Status** changes to **Ready To Connect**, click the sandbox.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2Fvb3ZEWJoRHZZKsyEDOXO%2FRefreshingASandbox-12.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Log In to the Sandbox

{% hint style="info" %}

#### Log In Before You Connect

Before you click **Connect**, log in to the refreshed sandbox as the dedicated administrator user you will connect with. The refreshed sandbox is a new Salesforce org, so Salesforce may ask this user to set up a passkey or an authenticator app again, even if it was done before the refresh. Completing this first makes the connection process smoother. To learn more about the dedicated administrator user, see the following article.

* [Creating a Dedicated Salesforce User](/global-settings/environment/organizations/creating-a-dedicated-salesforce-user.md)
  {% endhint %}

1. Click the sandbox's login URL under its name to copy the link.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2Fe0QLzXN3nn8mjoIctuyM%2FRefreshingASandbox-13.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>
2. Open a new browser tab and paste the login URL into the address bar.
3. Enter the **Username** and **Password** of the administrator user.
4. Click **Log In to Sandbox**.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FHjGvu18nNVjGqETveYht%2FRefreshingASandbox-14.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>
5. If Salesforce asks you to create a passkey, click **Create Passkey** and follow the prompts.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FBbmFbSo9OfHFA6vkaMjc%2FRefreshingASandbox-15.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>
6. Return to Sandbox Management.
   {% endstep %}

{% step %}

### Connect the Sandbox

1. Click **Connect**.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FIJdPwVjN8dWiJ6conhTa%2FRefreshingASandbox-16.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>
2. Enter the **Username** of the same administrator user.
3. Click **Log In to Sandbox** and complete the login.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FAEBKEQ7dBPGJ9QnJq5HQ%2FRefreshingASandbox-17.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>
4. Click **Allow**.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2F0rLfA7wKnvOIqoeYuaHY%2FRefreshingASandbox-18.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Review the Reconnected Sandbox

When the connection completes, the sandbox's existing organization in Global Settings is connected to the refreshed sandbox. It isn't added again, so it keeps its original **Created At** date.

1. Global Settings opens to the **Organizations** page, where you can view the sandbox's organization.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2F02sB2LNlppAedRPVfxeH%2FRefreshingASandbox-19.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Monitor the Template Steps

When the sandbox is connected, the template's steps start. They run one after another, in the order shown in the **Preview** panel. If you didn't select a template, the sandbox's **Status** changes to **Ready** when the connection completes.

1. In Sandbox Management, the sandbox's **Status** shows **Refreshing** and the current step while the template's steps run. Click the sandbox to view its details.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FyTV4bHy33ECuT7Kv2ib2%2FRefreshingASandbox-20.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>
2. The **Execution** tab shows the status of each step, and the **Org ID** in the **Overview** panel shows the refreshed sandbox's new Org ID.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2Fuin4Vi2Puu4b1ROLwd8g%2FRefreshingASandbox-21.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>
3. When every step is **Completed**, the sandbox's **Status** changes to **Ready**.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2Fte7bwoNlonnL90aEznDl%2FRefreshingASandbox-22.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flosum.com/sandbox-management/sandboxes/refreshing-a-sandbox.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
