> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mainwp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# When I Push Changes from Live to Staging, Child Site Needs to be Reconnected, Why?

> Pushing changes between Live and Staging overwrites the mainwp_child_pubkey in wp_options, breaking the connection. Exclude this field from sync or deactivate/reactivate the Child plugin to reconnect.

When you push changes between a live site and its staging copy (or vice versa), the MainWP connection often breaks. This happens because the synchronization process copies the public key that MainWP Child uses to verify requests from your MainWP Dashboard.

## What You'll Learn

* Why staging sync breaks the MainWP connection
* How to exclude the MainWP key from sync operations
* How to reconnect after syncing

***

## Why This Happens

MainWP uses digital signatures to authenticate requests from MainWP Dashboard. When a child site connects to your Dashboard:

1. MainWP Dashboard generates a unique public/private key pair for the site
2. This key is stored in the child site's database as `mainwp_child_pubkey` (in the `wp_options` table)
3. MainWP Child uses this public key to verify requests signed by the matching private key on MainWP Dashboard

When you sync databases between live and staging, the staging plugin copies the `mainwp_child_pubkey` value from one site to the other. This overwrites the correct public key, so MainWP Child can no longer verify requests signed with the private key that MainWP Dashboard holds for that site.

***

## Solution 1: Exclude the Key from Sync

The best approach is to configure your staging plugin to exclude the MainWP key from synchronization.

### WP Staging

**1. Open settings**

Navigate to **WP Staging > Settings**.

**2. Go to Advanced tab**

Select the **Advanced** tab.

**3. Add exclusion**

In the database exclusion section, add:

```text theme={null}
mainwp_child_pubkey
```

**4. Save settings**

Save your settings before the next push/pull operation.

### Duplicator Pro

**1. Create package**

During package creation, go to the **Database** tab.

**2. Find options section**

Under **Tables**, locate the options section.

**3. Add exclusion filter**

Add an exclusion filter for `option_name = 'mainwp_child_pubkey'`.

### WP Migrate

**1. Open migration settings**

In migration settings, go to **Advanced Options**.

**2. Add exclusion**

Add to the "Exclude Post Types" or custom SQL section:

```sql theme={null}
option_name = 'mainwp_child_pubkey'
```

### Other Staging Tools

Check your staging tool's documentation for database field exclusions. The goal is to prevent `mainwp_child_pubkey` from being copied during sync operations.

***

## Solution 2: Reconnect After Sync

If your staging tool doesn't support exclusions, reconnect the site after each sync:

**1. Access the staged site**

Log in to the staged site's wp-admin directly (not through MainWP).

**2. Navigate to Child settings**

Go to **Settings > MainWP Child**.

**3. Deactivate the plugin**

Click **Deactivate** (or deactivate from the Plugins page).

**4. Reactivate the plugin**

Reactivate the MainWP Child plugin.

**5. Reconnect from Dashboard**

Return to your MainWP Dashboard and reconnect the child site using the same process as initial setup.

***

## Prevention Tips

* Configure exclusions before your first staging sync
* Document which sites have staging environments
* Consider using separate MainWP Dashboards for staging networks if you manage many staging sites
* Test the exclusion by syncing and verifying the connection remains intact

***

## Self-Check Checklist

* [ ] Staging plugin configured to exclude `mainwp_child_pubkey`
* [ ] Test sync completed without breaking connection
* [ ] Documentation updated for your staging workflow

***

## Related Resources

* [OpenSSL Key Encryption](https://docs.mainwp.com/advanced/openssl-keys-encryption.md) - Private key encryption at rest
* [Reconnecting Child Sites](https://docs.mainwp.com/getting-started/child-plugin-5-2-1-reconnecting-child-sites-with-unique-security-id.md) - Reconnection process
* [Staging Extension](https://docs.mainwp.com/add-ons/development/staging-extension.md) - MainWP's built-in staging solution


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.