Refresh Staging

If you are using DEV, STAGE, and PROD servers, this pattern will be interesting to you.

Problem

How do we keep the staging server up to date with the latest code from the DEV server and the latest production data from the PROD server?

💡

This pattern will move all the data from the PROD server to the STAGE server. This may not be what you want. If you want to move only some of the data, that is more complicated.

Solution

Use two sub-deployments, one to pull the production data from the PROD server to STAGE and one to pull the latest code from the DEV server. Switch on the Abort remaining sub-deployments option. That way, if the first deployment fails, the second one will not run.

Advanced options

You will need to turn on the Advanced Options in the deployment settings to use sub-deployments and the abort remaining sub-deployments features.

Video walkthrough