function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
David MartinkaDavid Martinka 

Metadata API for automated sandbox refresh

Hi,
We would like to automate our sandbox refresh for a month period. Is this possible to do somehow?

We have also many connected apps and integrations that differs for each sandbox/production. So when we refresh e.g. STG sandbox, we need to set it all up for the particular sandbox. Is this possible to do via metadata api once the refresh is done?

Thank you in advance for any response.
VinayVinay (Salesforce Developers) 
Hi David,

Currently there is no automate process for sandbox refresh.  Below is idea link and you can vote.

https://success.salesforce.com/ideaView?id=08730000000DrRGAA0

Also you can review below link for 'Run Script After Sandbox Creation and Refresh' details.
 
https://releasenotes.docs.salesforce.com/en-us/spring16/release-notes/rn_deployment_sandbox_postcopy_script.htm

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
AnudeepAnudeep (Salesforce Developers) 
Hi David, 

Today it is not possible to automate/schedule a sandbox refresh. There is an open idea around it : https://success.salesforce.com/ideaView?id=08730000000knljAAA

You can use the API though to get new information into your sandbox using the Force.com Migration Tool (for metadata).

http://www.salesforce.com/us/developer/docs/daas/

https://help.salesforce.com/apex/HTViewHelpDoc?id=code_tools_ant_using.htm&language=en_US

Connected App is available under Metadata Components and Types

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_objects_intro.htm

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. Thank You!

Anudeep