feat(create-site): --local-db, --table-prefix flags + validation plan#2
Open
feat(create-site): --local-db, --table-prefix flags + validation plan#2
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--local-dbflag to skip RDS SSL enforcement for local MySQL dev/test hosts--table-prefix=PREFIXflag (defaultwp_) passed towp config create— needed when importing DBs with non-default prefixesstep_summarySSL line to reflect local mode correctlyplans/create-site-validation.mdwith step-by-step validation resultsValidation
All 10
step_*functions validated against a fresh Ubuntu 24.04 VPS. Full migration run completed:wp db export, imported on targetwp option get siteurlandwp post listconfirm site is liveTest plan
step_*show ✓ in validation tablebash -nsyntax check passeswp option get siteurlreturns correct domainwp post listreturns real contentCloses #1
🤖 Generated with Claude Code