Skip to content

feat(create-site): --local-db, --table-prefix flags + validation plan#2

Open
khoipro wants to merge 7 commits intomainfrom
feat/1-validate-create-site-v2
Open

feat(create-site): --local-db, --table-prefix flags + validation plan#2
khoipro wants to merge 7 commits intomainfrom
feat/1-validate-create-site-v2

Conversation

@khoipro
Copy link
Copy Markdown
Member

@khoipro khoipro commented May 9, 2026

Summary

  • Adds --local-db flag to skip RDS SSL enforcement for local MySQL dev/test hosts
  • Adds --table-prefix=PREFIX flag (default wp_) passed to wp config create — needed when importing DBs with non-default prefixes
  • Fixes step_summary SSL line to reflect local mode correctly
  • Adds plans/create-site-validation.md with step-by-step validation results

Validation

All 10 step_* functions validated against a fresh Ubuntu 24.04 VPS. Full migration run completed:

  • 81MB DB exported from source server via wp db export, imported on target
  • 14GB uploads rsynced directly server-to-server
  • URL search-replace completed; wp option get siteurl and wp post list confirm site is live

Test plan

  • All 10 step_* show ✓ in validation table
  • bash -n syntax check passes
  • wp option get siteurl returns correct domain
  • wp post list returns real content

Closes #1

🤖 Generated with Claude Code

khoipro and others added 7 commits May 9, 2026 15:28
Allows running create-site.sh against a local MySQL instance (dev/test
hosts) without the RDS-specific REQUIRE SSL enforcement. Validated
step-by-step on a fresh Ubuntu 24.04 VPS.

Findings from validation:
- step_clone_repo: repos using `master` branch need --git-branch=master
- step_summary: was printing hardcoded SSL line even in local mode; fixed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- --table-prefix=PREFIX passes custom table prefix to wp config create
  (default: wp_) — needed when importing DBs with non-default prefixes
- Add plans/create-site-validation.md with step-by-step results and
  migration notes from the masanconsumer validation run

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Installs certbot + python3-certbot-apache and obtains a Let's Encrypt
cert for a named site. Idempotent, non-interactive. --no-alias flag
skips the www SAN when www DNS isn't configured.

For VPS/bare-metal only — production EC2 uses ACM via ALB.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
step_htaccess writes the standard WordPress mod_rewrite block when no
.htaccess exists in public/. Skips if the file is already present
(e.g. committed in the repo); --force overwrites. Runs after
step_clone_repo so repo-provided rules take precedence.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
migrate-site.sh orchestrates a full VPS→EC2+RDS migration:
1. Provisions the site on EC2 via create-site.sh (RDS DB, vhost, FPM, wp-config)
2. Exports DB from staging MySQL, transfers and imports into RDS
3. Search-replaces staging domain → prod domain (when they differ)
4. Rsyncs wp-content/uploads/ staging→EC2 (incremental)
5. Writes .htaccess, flushes rewrites/cache, fixes permissions
6. Smoke-tests siteurl + latest post + uploads size

Reads all config from .env (see .env.sample). Safe to re-run.
Flags: --skip-provision, --skip-db, --skip-uploads, --dry-run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
End-to-end guide covering bootstrap, create-site, data migration via
migrate-site.sh, DNS cutover, and post-cutover tasks (cron, S3 backup,
RDS SSL verification).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generic step-by-step guide (bootstrap → create site → RDS DB → sync
data → DNS cutover) with placeholder variables instead of site-specific
values. Includes table of contents and quick reference table.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate create-site.sh against a live WordPress site install

1 participant