# SiteGround SFTP Backup (July 2026)

When SiteGround hosting is decommissioned (migrating to app3 netcup), all 21 sites were backed up to Wasabi S3 via SFTP.

## Key Constraints

- **No remote shell access.** SiteGround's SFTP on port 18765 blocks `exec_command()` — no remote `tar`, no `find | wc`, no `echo`. Only pure SFTP operations (listdir, read, write). This means per-file streaming over the SFTP channel, which is very slow for large WordPress sites with thousands of files.
- **Directory structure:** Sites live at `/<domain>/<domain>/public_html` (nested directory with same name as site).
- **Speed:** Each file requires a separate SFTP round-trip to open and read. The backup script uses `paramiko.SFTPClient` to recursively traverse directories and stream each file into a local `tarfile` in Python. For a 14K-file site, this takes 20-30 minutes.

## SFTP Credentials

Stored in the recovery manual and /root/.ssh/siteground.key (chmod 600). Key is DES-EDE3-CBC encrypted with passphrase `LoveMyBoys73!`.

## Restore Process

To restore a site from the S3 backup to a new host:
1. Pull the backup: `aws s3 cp s3://hermes-vps-backups/siteground/<domain>/<domain>-<date>.tar.gz .`
2. Extract: `tar xzf <domain>-<date>.tar.gz -C <target-dir>`
3. Import MySQL database (needs a separate SQL dump — SFTP doesn't cover MySQL)
4. Update wp-config.php with new DB credentials
5. Point DNS to the new host IP
6. Run `coolify` (or the site provisioning tool on app3) to wire up SSL

## Note on MySQL

Only site FILES were backed up via SFTP. The MySQL databases were NOT exported during the SFTP backup. To migrate a WordPress site fully, a MySQL dump is also needed from the SiteGround phpMyAdmin or via the existing RunCloud MySQL connection.
