# Move from a VPS or your own server

> Export your site from a VPS or your own server and move it to WP Waterfall with the free migration, then switch the domain.

Source: https://docs.wpwaterfall.com/migrate/from-vps

This guide is for a WordPress site on a server you run, with or without a panel such as SpinupWP, RunCloud, GridPane, Ploi, or ServerPilot. You make one archive over SSH, hand it to WP Waterfall, and switch the domain.

## What you need

- SSH access as the site's user, and wp-admin access to the site. WP-CLI helps.
- A free site license, and a backup file in a format that [Migrate a site to WP Waterfall](https://docs.wpwaterfall.com/migrate-a-site#what-do-i-need) lists.

## Export your site from the server

**Find the docroot and the database.** Panels put sites in different folders, so ask the web server:

```
sudo nginx -T | grep -E "server_name|root"
sudo apachectl -S
```

The docroot holds `wp-config.php`, though WordPress also allows it one folder above. Unsure? Run `sudo find / -name wp-config.php -not -path "/proc/*" 2>/dev/null`. Read the database from the site, not from a guess:

```
wp config get DB_NAME --path=/path/to/docroot
wp config get table_prefix --path=/path/to/docroot
```

**Best route: WP-CLI, then tar.** Run as the site's user:

```
cd /path/to/docroot
wp db export ~/site.sql --add-drop-table
tar -czf ~/site-move.tar.gz --exclude='wp-content/cache' -C /path/to/docroot wp-content -C ~ site.sql
```

A zip works too: `zip -r ~/site-move.zip wp-content -x "wp-content/cache/*"`, then `cd ~ && zip site-move.zip site.sql`. Copy the file out with `scp` or SFTP.

**No WP-CLI.** Use `mysqldump --no-tablespaces -u DBUSER -p DBNAME > ~/site.sql` with the values from `wp-config.php`, then the same `tar`. Keep the dump out of the web root.

**Panel backups.** The panels above can back up sites, but their file layouts differ. Open the backup. If it holds `wp-content` and one database export, send it. If not, use WP-CLI. A server snapshot is not a WordPress archive.

## Prepare the archive

Panels often add page cache or Redis files. Remove a page cache plugin and its `advanced-cache.php`, or a person will look at the migration before it runs.

## What does not move?

Besides [the usual list](https://docs.wpwaterfall.com/migrate-a-site#what-moves-and-what-do-i-set-up-again), these stay behind:

- System cron jobs. Check `crontab -l` and `/etc/cron.d`, then recreate them under **Cron**.
- Redirects in Nginx, Apache, or `.htaccess`. Import them under **Redirects**.
- Firewall and WAF rules. Add IP blocks under **IP Deny**.
- Other sites and the server software.

## Request the migration and switch the domain

Share the file as a public link, then follow [Migrate a site to WP Waterfall](https://docs.wpwaterfall.com/migrate-a-site) to request the migration. That article also covers what moves, what you set up again, how to switch the domain, and how to roll back. DNS usually sits at the registrar or at Cloudflare. If you run your own nameservers, edit the zone there.

## Troubleshooting

- `wp` cannot find WordPress: add `--path=/path/to/docroot`, and run it as the site's user.
- The export is huge: exclude cache and backup folders, and run `gzip site.sql`.
- Object cache errors: a leftover drop-in or caching plugin. Read the error log under **Logs**.

## Related

- [Migrate a site to WP Waterfall](https://docs.wpwaterfall.com/migrate-a-site)
- [Move it by hand](https://docs.wpwaterfall.com/migrate/from-generic-wordpress), for when the importer sends your archive to a person or you prefer to do it by hand
- Docs: [WP-CLI wp db export](https://developer.wordpress.org/cli/commands/db/export/), [RunCloud backups](https://runcloud.io/docs/category/backup), [Ploi databases](https://ploi.io/documentation/database), [GridPane WP-CLI](https://gridpane.com/kb/gp-wp-cli/), [ServerPilot SSH](https://serverpilot.io/docs/guides/ssh/)
