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

# Push a local site

> Push a local WordPress installation into a public SandyWP sandbox from the command line.

Run `sandywp push` from a local WordPress installation to mirror its database and `wp-content` into a SandyWP sandbox. This works with Cove, LocalWP, MAMP, XAMPP, and other local stacks.

## Before you start

* Authenticate the [SandyWP CLI](/cli) with `sandywp auth login`.
* Start the local WordPress database.
* Make either `wp` (WP-CLI) or `php` available on `PATH` so the CLI can export the database.

## First push

Run the command from the WordPress folder or anywhere below it. The CLI walks upward to find `wp-config.php`.

```sh theme={null}
cd ~/Sites/my-local-site
sandywp push
```

The first push creates a new sandbox, restores the local database and `wp-content`, then writes a `.sandywp` link file beside `wp-config.php`. It prints the new public URL and magic login URL.

Add `.sandywp` to `.gitignore`. It is a local link to one specific sandbox and should not be committed.

## Push again

A later `sandywp push` from the same folder updates the linked sandbox in place. The URL stays the same, but the sandbox database and files are overwritten.

```sh theme={null}
# Confirm interactively, or skip confirmation in a script.
sandywp push
sandywp push --force
```

If the linked sandbox was deleted, the CLI can create a replacement and update the link. A failed push leaves the existing sandbox unchanged.

## Good to know

Push is one-way: local changes replace changes made directly in SandyWP on the next push. Delete `.sandywp` when you want the next push to create a new sandbox instead.

Subdomain multisite is not supported. Single-site installs and subdirectory multisite networks are supported.

## Troubleshooting

| Message                             | What to do                                                               |
| ----------------------------------- | ------------------------------------------------------------------------ |
| `No wp-config.php found`            | Run the command from the WordPress installation or a directory below it. |
| Neither `wp` nor `php` is available | Install WP-CLI or expose the local stack's PHP binary on `PATH`.         |
| Database export fails               | Start the local database, then retry.                                    |
| A script waits for confirmation     | Add `--force`.                                                           |

For a live source site instead of a local one, use [Clone a site](/guides/clone-a-site). The lower-level import workflow is documented in [Imports API guidance](/api-reference/imports).
