Skip to main content
New tool CRON Expression Builder — preview next run times before you schedule Apex. Open the builder →
Diagram illustrating the process of Salesforce sandbox recovery using Git and Metadata API tools.
DevOps

Salesforce Sandbox Refresh Stuck in Queue? Fix and Recover

A sandbox refresh stuck in Pending or Processing is usually waiting its turn in a first-in-first-out queue, and Support can't move it forward. Here is how to read its real status and queue position, when to open a case, and how to back up a sandbox before you refresh it.

The short answer

A sandbox refresh showing Pending (In Queue) or Processing usually isn't broken, because Salesforce copies sandboxes through a first-in-first-out queue per sandbox size and Support can't move you up it. Open a case only if the status is Suspended or Stopped for more than an hour, or the refresh runs far past your org's usual copy time.

Key takeaways Treat Pending and Processing as waiting. The copy queue is first-in-first-out per sandbox size, and Support can't expedite it. Query SandboxProcess in production with the Tooling API to read Status and CopyProgress, and use the In Queue stage's EstimatedTotalWork for your queue position. Open a Support case only when the status is Suspended or Stopped for more than 1 hour, and have the sandbox name and org ID ready. Before every refresh, back up metadata to Git and export test data parents first, because a refresh can't be rolled back. Refresh early and hold the copy in Pending Activation so you can still Discard it. After activation, update anything that stores the sandbox org ID.

A sandbox refresh that shows Pending (In Queue) or Processing usually isn't broken. Salesforce copies sandboxes through a first-in-first-out queue, with separate queues by sandbox size, and Support can't move you up it. Open a case only if the status is Suspended or Stopped for more than an hour, or if the refresh runs far past your org's usual copy time.

Salesforce documents this behaviour in Best Practices for Salesforce Sandbox Creation and Refresh Times. None of it is specific to one cloud, so a Service Cloud org's sandboxes queue the same way as any other org's.

Why a sandbox refresh gets stuck in the queue

The queue is first-in-first-out, and your place in it decides when the copy starts. Salesforce runs separate queues for different sandbox sizes, and two requests of the same type back up behind each other. If your team requests three Partial Copy refreshes on the same morning, the third waits for the first two.

Demand changes over the year. It peaks during Salesforce release transitions, when many customers refresh at once, and that contention means more time in Pending. Sandbox copies also run on shared infrastructure and can be throttled based on system load. Copy work has a lower priority than synchronous changes people are making in sandboxes.

Once the copy starts, the size and shape of the org matter. Larger orgs with heavy customization take longer to copy, because they have more objects and more relationships between them. The lever you control here is how much data you copy; on non-Hyperforce instances, Salesforce recommends trimming it with a sandbox template.

On Hyperforce, a Full sandbox refresh uses Quick Create when it's available. Resource limits on shared infrastructure can push it back to the legacy method, which is slower. Support can't override the method and can't expedite the copy. The Sandboxes list page in Setup shows a Hyperforce badge, so you can see which case applies to you. For a rough idea of legacy copy times in your own org, look at how long sandboxes created before October 2025 took.

Salesforce doesn't give a time estimate. Sandboxes aren't guaranteed to complete by a certain time, and I'd distrust any post that quotes hour ranges per sandbox type. Your own refresh history is the only baseline worth using.

Sandbox refresh statuses and what to do

The Status values below come from the Tooling API SandboxProcess reference. Use the value in parentheses when you filter in SOQL.

Status (SOQL value) What it means What to do
Pending (0) In the queue, not started Wait, and check your queue position
Processing (2) Data and metadata are being copied Wait, and track CompletedWork
Pending Activation (4) The copy finished and is waiting for you Activate it, or Discard to keep the old sandbox
Completed (1) Done Log in and run your post-refresh steps
Suspended (S) / Stopped (G) The copy has halted If it lasts more than 1 hour, open a Support case with the sandbox name and org ID

Check queue position and progress with SandboxProcess

The Sandboxes page in Setup shows a status. The Tooling API gives you more detail. Run this query against the production org, because that's where SandboxProcess records live. The latest record for a sandbox reflects its current state, so order by CreatedDate and take the first row.

SELECT SandboxName, Status, CopyProgress, StartDate, EndDate
FROM SandboxProcess
WHERE SandboxName = 'uat'
ORDER BY CreatedDate DESC
LIMIT 1

From the CLI:

sf data query --use-tooling-api --target-org prod --query "SELECT SandboxName, Status, CopyProgress, StartDate, EndDate FROM SandboxProcess WHERE SandboxName = 'uat' ORDER BY CreatedDate DESC LIMIT 1"

CopyProgress shows how much of the copy is complete for Developer, Developer Pro and Full sandboxes. For more detail, each process has SandboxProcessStage records, one for each stage. While the In Queue stage is running, its EstimatedTotalWork field holds your current place in the queue, which is the closest Salesforce comes to an ETA. During the Data Copy and Activation stages, compare CompletedWork with ActualTotalWork when IsActualWorkFinal is true, and with EstimatedTotalWork when it's false. If you want to start, poll and activate refreshes from a script, see how to script the sandbox refresh with the Tooling API.

How to back up a Salesforce sandbox before you refresh

A refresh has no undo. The sandbox gets a fresh copy from production, so back up what production doesn't have: the metadata you built in the sandbox and the test data you loaded into it.

For metadata, the best backup is source that's already in Git. If some of it isn't, retrieve it into a Git-tracked Salesforce DX project and commit it before you click Refresh.

sf project retrieve start --manifest package.xml --target-org uat
git add force-app package.xml
git commit -m "Snapshot uat before refresh"

For test data, export each object to CSV with Data Loader or sf data export bulk. Export parents before children and keep the Ids, because you'll need them to rebuild lookups when you load the data back. For a Service Cloud test set, that could look like this:

sf data export bulk --query "SELECT Id, Name, Type FROM Account" --output-file backup/uat-accounts.csv --result-format csv --target-org uat --wait 10
sf data export bulk --query "SELECT Id, AccountId, FirstName, LastName, Email FROM Contact" --output-file backup/uat-contacts.csv --result-format csv --target-org uat --wait 10
sf data export bulk --query "SELECT Id, AccountId, ContactId, Subject, Status, Priority FROM Case" --output-file backup/uat-cases.csv --result-format csv --target-org uat --wait 10

Some configuration needs its own checklist. Named Credentials vanish after a refresh, so list everything you'll have to re-create before you start.

Also check whether you need a refresh at all. The Best Practices article names updating a sandbox with the Metadata API or Bulk API as the alternative. If the sandbox is mostly right and has only drifted, deploying from Git and reloading a few objects is faster than waiting in the queue, and nothing gets wiped.

Refreshing without losing work: the 5 steps

  1. Confirm that the refresh interval has passed. Developer and Developer Pro sandboxes can be refreshed every 1 day, Partial Copy every 5 days and Full every 29 days. The interval is counted from when the previous creation or refresh was requested (Refresh Your Sandbox). You need the Manage Sandboxes permission, or Manage Dev Sandboxes for Developer and Developer Pro.
  2. Commit any uncommitted work. Push Apex, LWC, flows and other metadata to Git. Anything that isn't in source control is lost.
  3. Export the test data you can't regenerate, with the commands above or Data Loader, and store the files outside the sandbox.
  4. In Setup, open Sandboxes, find the row and click Refresh. For Partial Copy, choose the right sandbox template. Leave Auto Activate unselected if you want the option to Discard later; Salesforce then emails you when the sandbox is ready to activate.
  5. Monitor, activate, then run your post-refresh steps. Watch SandboxProcess as shown above. After activation the sandbox has a new org ID and may be on a different instance, so update integrations, named credentials and anything else that stores the org ID. Re-import test data and reapply data masking if your org requires it. A SandboxPostCopy Apex class can automate the repeatable parts.

You can't roll back a refresh. While it's in Pending Activation you can Discard it and keep working in the current sandbox, which is the reason to refresh early and activate later.

Depending on your Salesforce sandbox types, a refresh can take far longer than you'd like, or wipe work you wanted to keep. When a refresh isn't an option, the next sections cover how to repair a broken sandbox where it is.

Common scenarios for Salesforce sandbox recovery

Sandbox disasters usually fall into a few groups. A developer deletes a custom object, thinking they're in a personal dev org. A "quick" data load goes wrong because nobody turned off a flow, and thousands of unwanted records appear.

Then there's the refresh that doesn't land. You start it on Friday, expecting to work in it on Monday, and it's still Processing on Monday morning. Or it completes, but the data is so inconsistent that your tests won't run. First work out whether the problem is metadata or data, because the recovery path is different for each.

A high-fidelity UI mockup of a Salesforce sandbox management dashboard showing environment status lists and diagnostic technical panels.

A high-fidelity UI mockup of a Salesforce sandbox management dashboard showing environment status lists and diagnostic technical panels.

Practical strategies for Salesforce sandbox recovery

What you can do depends on what you backed up.

1. Use your metadata backups

If your source is in Git, redeploy Apex classes, flows and layouts from it. Without a CI/CD pipeline, you can still use the Metadata API or Change Sets to pull missing pieces from production or from a healthy sandbox. It's manual, but it works when you're stuck.

2. Data Loader for record restoration

When the data is the problem, use Data Loader. If you take regular exports, map those CSVs back into the sandbox, parents first and children second, so the lookups resolve. If you're managing Salesforce large data volumes, switch Data Loader to the Bulk API for the large objects. For ongoing hygiene, it pays to keep sandbox data in sync with production so that a rescue only covers a small gap.

"Never treat a sandbox refresh as a backup strategy. A refresh is a destructive action that replaces everything. If you haven't committed your code to Git or backed up your test data, that work is gone forever the moment you click 'Refresh'."

3. When to call Salesforce Support

Salesforce gives one documented threshold. If the sandbox status is Suspended or Stopped for more than 1 hour, contact Salesforce Support with the sandbox name and org ID. Pending and Processing aren't on that list. Support can't expedite a copy that's waiting in the queue, and it can't override the copy method Hyperforce picks. I have seen a team lose a day chasing a case about a Pending refresh that was simply waiting its turn, when a metadata deploy would have unblocked their testers by lunchtime. For a refresh in Processing, open a case only when it runs far past what your own history says is normal for that sandbox.

Best practices to avoid the headache

Teams get burned when they treat sandboxes as a playground where nothing matters. Then a release is blocked because the Full sandbox is a mess, and suddenly it matters a lot. A few habits keep it from getting there.

  • Log every data load with what was imported, when and by whom. That makes mistakes much easier to undo.
  • Limit who can refresh. Not every admin needs permission to refresh the Full sandbox.
  • Audit regularly. Every few weeks, check whether sandbox metadata has drifted from production. The sooner you spot the gap, the easier the Salesforce sandbox recovery will be.
  • Use Partial Copy sandboxes within their data limits. Don't try to fit a production-sized dataset into one.
  • Request refreshes early and away from release-transition weekends; you can activate later.

What to watch for

  • CopyProgress isn't available for Full or Partial Copy sandboxes created from templates. For those, poll Status and the work counts on the SandboxProcessStage records.
  • Salesforce deletes a new sandbox that hasn't been activated within 30 days, after sending at least two email notifications.
  • Every refresh gives the sandbox a new org ID, and the sandbox can move to a different instance. Anything that hard-codes either value will break.
  • On Hyperforce, a Full refresh can fall back from Quick Create to the slower legacy method, and Support can't change that.
  • Between major release upgrades, Salesforce tries to create preview sandboxes by default. Check which release a refreshed sandbox is on before you run release tests in it.

FAQ

Why is my Salesforce sandbox refresh stuck in queue?

Sandbox copies go through a first-in-first-out queue, with a separate queue for each sandbox size, so your request waits behind earlier requests of the same type. Demand peaks around Salesforce release transitions, and copies are throttled on shared infrastructure, so a refresh can stay in Pending for a long time. Support can't move you up the queue.

How long does a Salesforce sandbox refresh take?

Salesforce doesn't guarantee a completion time. It depends on your queue position, the amount of data and customization in the org, and demand around release transitions. On Hyperforce, Full sandboxes use Quick Create when it's available but can fall back to the slower legacy method.

When should I contact Salesforce Support about a stuck sandbox refresh?

Contact Support if the status has been Suspended or Stopped for more than 1 hour, and include the sandbox name and org ID. Support can't expedite a copy that's waiting in the queue.

How often can I refresh a Salesforce sandbox?

Developer and Developer Pro sandboxes can be refreshed every 1 day, Partial Copy every 5 days, and Full every 29 days. The interval is counted from the date you requested the previous creation or refresh.

Can I undo or cancel a sandbox refresh?

You can't roll back a refresh. While the refresh is in Pending Activation, you can Discard it and keep using the current sandbox, which is why it helps to refresh early and activate later.

How do I back up a sandbox before refreshing it?

Retrieve the metadata into a Git-tracked Salesforce DX project with sf project retrieve start and commit it. Then export test data object by object with Data Loader or sf data export bulk, parents before children. A refresh replaces everything in the sandbox, so anything you haven't saved this way is lost.

Frequently asked questions

Why is my Salesforce sandbox refresh stuck in queue?

Sandbox copies go through a first-in-first-out queue, with a separate queue for each sandbox size, so your request waits behind earlier requests of the same type. Demand peaks around Salesforce release transitions, and copies are throttled on shared infrastructure, so a refresh can stay in Pending for a long time. Support can't move you up the queue.

How long does a Salesforce sandbox refresh take?

Salesforce doesn't guarantee a completion time. It depends on your queue position, the amount of data and customization in the org, and demand around release transitions. On Hyperforce, Full sandboxes use Quick Create when it's available but can fall back to the slower legacy method.

When should I contact Salesforce Support about a stuck sandbox refresh?

Contact Support if the status has been Suspended or Stopped for more than 1 hour, and include the sandbox name and org ID. Support can't expedite a copy that's waiting in the queue.

How often can I refresh a Salesforce sandbox?

Developer and Developer Pro sandboxes can be refreshed every 1 day, Partial Copy every 5 days, and Full every 29 days. The interval is counted from the date you requested the previous creation or refresh.

Can I undo or cancel a sandbox refresh?

You can't roll back a refresh. While the refresh is in Pending Activation, you can Discard it and keep using the current sandbox, which is why it helps to refresh early and activate later.

How do I back up a sandbox before refreshing it?

Retrieve the metadata into a Git-tracked Salesforce DX project with sf project retrieve start and commit it. Then export test data object by object with Data Loader or sf data export bulk, parents before children. A refresh replaces everything in the sandbox, so anything you haven't saved this way is lost.

Newsletter

One email every Tuesday

New guides, tool updates, and the release-note changes that break things.

No spam. Unsubscribe in one click.

Comments

Loading comments...

Leave a Comment