YStack WP Migrate
Push/Pull WordPress sites via S3-compatible storage (Cloudflare R2)
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/yansircc/ystack-wp-migrate/archive/refs/heads/main.zipPush/Pull WordPress sites via S3-compatible storage (Cloudflare R2).
One-click push from source site, one-command (or one-click installer) pull on target site.
Requirements
- PHP 8.0+
- WordPress 6.0+
curlandZipArchivePHP extensions- A Cloudflare R2 bucket with a Worker proxy (see Setup)
- Pull via CLI: WP-CLI on the target site
- Pull via Installer: No extra requirements — just upload
installer.php
Installation
- Download or clone this repo into
wp-content/plugins/ystack-wp-migrate/ - Activate the plugin in WordPress admin
- Configure R2 credentials (see below)
R2 Setup
Add to wp-config.php on both source and target sites:
define('YSWM_R2_WORKER', 'https://your-worker.workers.dev');
define('YSWM_R2_TOKEN', 'your-bearer-token');
You need a Cloudflare Worker that proxies PUT/GET/DELETE requests to an R2 bucket with bearer token auth. A minimal Worker example is in docs/worker-example.js (coming soon).
Usage
Push (source site)
- Go to Tools → YStack WP Migrate
- Click Push Full Site
- Copy the migration code from the output
Pull — Option A: WP-CLI (target site)
Run on the target site:
wp eval-file wp-content/plugins/ystack-wp-migrate/pull-cli.php -- --code='MIGRATION_CODE'
Pull — Option B: Installer (target site)
- Click Download installer.php (migration code + R2 credentials are pre-baked)
- Upload
installer.phpto the target site's root directory - Open
https://target-site.com/installer.phpin your browser - Click Start Migration
- The installer self-deletes after completion
What gets migrated
- Database (all tables, prefix-remapped)
- Uploads (
wp-content/uploads/) - Themes (
wp-content/themes/) - Plugins (
wp-content/plugins/) - Serialization-aware search-replace (URLs + file paths)
Configuration
| Constant | Required | Description |
|---|---|---|
YSWM_R2_WORKER |
Yes | Cloudflare Worker URL |
YSWM_R2_TOKEN |
Yes | Bearer token for Worker auth |
YSWM_STORAGE_DIR |
No | Override migration temp storage path |
License
GPL-2.0-or-later. See LICENSE.