Skip to content


How-to Guides

Technical References

VIP Dashboard /

Data sync from production to non-production environments

Data syncs on WordPress VIP occur only from production environments to non-production environments. Data syncs facilitate testing and QA of new features and allows teams to accurately reproduce and examine errors in a non-production environment.

WordPress VIP’s UnionFS allows media files uploaded to the production environment to be available to non-production environments in read-only mode. After a data sync, media file URLs on the target environment will automatically point to the shared files.

Actions that occur during a data sync

The operation is designed to not impact the production site in any way; all processing happens on the target environment:

  1. The target environment is protected via “maintenance mode”; this prevents access to the site while the data is being restored and manipulated, and ensures no changes can be made (and lost) during this time.
  2. The most recent backup from production is loaded into the target environment.
  3. Occurrences of the primary production domain in the database is replaced with the primary domain for the target environment. For example, if the production site domain is and the target non-production site domain is, then all instances of will be replaced with in the target database after the sync.
  4. Protected options are restored.
  5. The wp vip data-cleanup datasync CLI command is run for further cleanup.
    • Jetpack is (re)connected.
    • Caches are flushed.
  6. Maintenance mode is deactivated.


For WordPress multisite environments on VIP, data syncs require a domain mapping config file.

Running a data sync via the VIP Dashboard

Data syncs can be initiated in the VIP Dashboard. Once logged into the VIP Dashboard

  • Navigate to the “Data” link in the left-hand navigation menu.
  • Choose the destination environment for the data sync at the top of the dashboard (e.g., “Develop”).
  • Click on “Copy from Production”.
  • Follow the prompts in the dashboard and click on the “Copy Data” button when ready.

Running a data sync via CLI

To run the following commands, VIP-CLI must first be installed on your local machine.

Step 1: Find the application name or ID you wish to sync

You can do this with the vip app list command, which will give you back a list of apps. You want the name or the id.

Step 2: Initiate the sync

Run the sync command with the app name, e.g. vip sync --app=my-app, or the app id, e.g. vip sync --app=000. You will be prompted for the environment you wish to sync to, i.e. the target environment. You can get more information about sync command options by using the help parameter, i.e. vip sync --help.

Protected options

The following options are protected during data syncs, meaning they are backed up on the child site before the sync and restored afterwards. This is to prevent environment-specific configs from being shared between environments.

"WP Options" = [

// On multisites
"Site Meta" = [

Custom cleanup operations

The vip_datasync_cleanup hook can be used for custom cleanup of your application data. Some examples of cleanup operation include removing production API keys or performing brief data manipulation.

Example code that shows you how to use this cleanup event:

 * Run some custom cleanup after a migration.
 * @uses vip_datasync_cleanup
function my_action_vip_datasync_cleanup() {
    // Safety first: Don't do anything in 
    // the production environment
    if ( 'production' === VIP_GO_APP_ENVIRONMENT ) {
    delete_option( 'my_social_api_token' );
add_action( 'vip_datasync_cleanup', 'my_action_vip_datasync_cleanup' );

On a multisite, the cleanup hook is run individually on each subsite within that multisite.

Last updated: November 04, 2021