EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
WordPress Egg Architecture Migration Status

✅ COMPLETED TASKS

1. Repository Migration to Egg Architecture

  • ✅ Migrated all 10 WordPress repos to egg pattern
  • ✅ Removed WordPress core files (wp-admin, wp-includes, wp-*.php)
  • ✅ Kept wp-content in Git (themes, plugins, uploads)
  • ✅ Added docker-init.sh (downloads WordPress, generates config, syncs to bucket)
  • ✅ Added sync-content-to-bucket.sh (bidirectional sync tool)
  • ✅ Updated .gitignore (exclude core, keep content)
  • ✅ Created comprehensive README for each repo
  • ✅ Committed and pushed to GitHub

Repos migrated:

  1. wordpress-performwritecom (wp-content: 619M)
  2. wordpress-sfnm (wp-content: 336M)
  3. wordpress-redheale (wp-content: 32M)
  4. wordpress-path2ucom
  5. wordpress-outdoor1
  6. wordpress-murwillu
  7. wordpress-murbahmowers
  8. wordpress-laserxperts
  9. wordpress-kandudeliveriesc
  10. wordpress-corne582

2. Database Security

  • ✅ Created 16 isolated MySQL users (32-char passwords)
  • ✅ Each user restricted to single database
  • ✅ Updated all database URLs to App Platform URLs
  • ✅ Documented in WORDPRESS_ISOLATED_DB_CREDENTIALS.md

3. Architecture Documentation

🔄 IN PROGRESS

handsofd Lightsail Push

  • 🔄 Pushing wp-content from Lightsail to GitHub
  • Status: git clone running (large 1GB repo)
  • Command executing: /tmp/handsofd-git-push.sh
  • Monitor: Check GitHub API for new commit from "WordPress Lightsail"
# Check status
curl -s -H "Authorization: token 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" \
https://api.github.com/repos/Independent-Business-Group/wordpress-handsofd/commits?per_page=1 | \
jq -r '.[0] | .commit.author.name + ": " + .commit.message'

Expected commit message: "Backup wp-content from Lightsail instance"

⬜ PENDING TASKS

CRITICAL - Required for Deployment

1. Create DO Spaces Buckets (MANUAL STEP REQUIRED)

Method: DigitalOcean Web Console (https://cloud.digitalocean.com/spaces)

Create these 10 buckets:

  • wordpress-performwritecom-content
  • wordpress-sfnm-content
  • wordpress-redheale-content
  • wordpress-path2ucom-content
  • wordpress-outdoor1-content
  • wordpress-murwillu-content
  • wordpress-murbahmowers-content
  • wordpress-laserxperts-content
  • wordpress-kandudeliveriesc-content
  • wordpress-corne582-content

Settings:

  • Region: NYC3
  • CDN: Enable (recommended)
  • File Listing: Restrict File Listing

Why manual: doctl doesn't support bucket creation, Python boto3 requires package installation

2. Upload wp-content to Buckets

Once buckets are created, use this script:

# Install s3cmd
sudo apt install s3cmd
# Configure s3cmd
cat > ~/.s3cfg << 'EOF'
[default]
access_key = DO003JUHBJDDCCF9D6MU
secret_key = YOUR_SECRET_KEY
host_base = nyc3.digitaloceanspaces.com
host_bucket = %(bucket)s.nyc3.digitaloceanspaces.com
use_https = True
signature_v2 = False
EOF
# Upload wp-content for each site
cd /tmp/wordpress-repos
for repo in wordpress-*/; do
site=$(basename "$repo" | sed 's/wordpress-//')
bucket="wordpress-${site}-content"
echo "Uploading $site to $bucket..."
s3cmd sync "$repo/wp-content/" "s3://$bucket/wp-content/" \
--exclude 'cache/*' \
--exclude 'upgrade/*' \
--exclude 'backups/*' \
--delete-removed \
--acl-public
done

3. Create Separate Access Keys (SECURITY)

Current: Shared key DO003JUHBJDDCCF9D6MU (testing only!)

Required: 10 separate keys (one per site)

Steps:

  1. Go to https://cloud.digitalocean.com/account/api/spaces
  2. Click "Generate New Key"
  3. Name: wordpress-performwritecom-key
  4. SAVE SECRET KEY (shown only once!)
  5. Repeat for each site

Key names:

  • wordpress-performwritecom-key
  • wordpress-sfnm-key
  • wordpress-redheale-key
  • wordpress-path2ucom-key
  • wordpress-outdoor1-key
  • wordpress-murwillu-key
  • wordpress-murbahmowers-key
  • wordpress-laserxperts-key
  • wordpress-kandudeliveriesc-key
  • wordpress-corne582-key

4. Update App Platform Environment Variables

For each of the 10 apps, add these variables:

BUCKET_NAME=wordpress-{sitename}-content
BUCKET_ENDPOINT=nyc3.digitaloceanspaces.com
BUCKET_ACCESS_KEY={site-specific-key}
BUCKET_SECRET_KEY={site-specific-secret}

Method 1: DigitalOcean Web Console

  1. Go to https://cloud.digitalocean.com/apps
  2. Select app
  3. Settings → Environment Variables
  4. Add the 4 bucket variables
  5. Save (triggers automatic redeploy)

Method 2: doctl CLI

# Get current app spec
doctl apps spec get {app-id} > app-spec.yaml
# Edit app-spec.yaml to add:
# - key: BUCKET_NAME
# value: wordpress-performwritecom-content
# - key: BUCKET_ENDPOINT
# value: nyc3.digitaloceanspaces.com
# - key: BUCKET_ACCESS_KEY
# value: DO003...
# - key: BUCKET_SECRET_KEY
# value: xxxxx...
# Update app
doctl apps update {app-id} --spec app-spec.yaml

Apps that need updating:

  1. wordpress-performwritecom-7alzt
  2. wordpress-sfnm-jm5r4
  3. wordpress-redheale-hgz9y
  4. wordpress-path2ucom-6sxj8
  5. wordpress-outdoor1-9tk2m
  6. wordpress-murwillu-4vh3k
  7. wordpress-murbahmowers-p7n2z
  8. wordpress-laserxperts-8qw5x
  9. wordpress-kandudeliveriesc-5ry6v
  10. wordpress-corne582-3mx4t

5. Monitor Deployments

After updating env vars, apps will automatically redeploy:

# List apps
doctl apps list
# Monitor specific app deployment
doctl apps get-deployment {app-id} {deployment-id}
# View logs
doctl apps logs {app-id}

Expected deployment flow:

  1. Phase: PENDING → BUILDING → DEPLOYING → ACTIVE
  2. Logs show: "Downloading WordPress core..."
  3. Logs show: "Generating wp-config.php..."
  4. Logs show: "Syncing wp-content to bucket..."
  5. Logs show: "Starting web server..."

6. Test Deployment (Start with performwritecom)

# Test site loads
curl -I https://wordpress-performwritecom-7alzt.ondigitalocean.app
# Should return: HTTP/1.1 200 OK
# Check admin access
curl -I https://wordpress-performwritecom-7alzt.ondigitalocean.app/wp-admin/
# Test that bucket has content
s3cmd ls s3://wordpress-performwritecom-content/wp-content/uploads/ --recursive | head -20

OPTIONAL - Future Improvements

7. Fix collegeo App (No Ingress)

  • Issue: collegeo app has no ingress route configured
  • Fix: Add route in app spec or web console

8. Deploy Missing Apps

  • coomerawatersrea
  • pits
  • soilife
  • vastcons

9. handsofd Bucket Migration (Optional)

  • Create wordpress-handsofd-content bucket
  • Upload handsofd wp-content from Lightsail
  • Configure Lightsail to serve media from CDN
  • Benefit: Faster media delivery, offload storage from VM

📊 Migration Progress

Database Security: ████████████████████ 100% (16/16 users created)
Repository Migration: ████████████████████ 100% (10/10 repos migrated)
handsofd Lightsail: ████████████░░░░░░░░ 60% (clone in progress)
Bucket Creation: ░░░░░░░░░░░░░░░░░░░░ 0% (MANUAL STEP NEEDED)
Content Upload: ░░░░░░░░░░░░░░░░░░░░ 0% (depends on buckets)
Access Keys: ░░░░░░░░░░░░░░░░░░░░ 0% (1 shared, need 10 separate)
Env Vars Update: ░░░░░░░░░░░░░░░░░░░░ 0% (buckets not created yet)
App Deployments: ░░░░░░░░░░░░░░░░░░░░ 0% (waiting for env vars)
Testing: ░░░░░░░░░░░░░░░░░░░░ 0% (waiting for deployment)

🚦 Next Action Required

IMMEDIATE: Create 10 DO Spaces buckets via web console

  1. Open browser: https://cloud.digitalocean.com/spaces
  2. Click "Create Bucket" or "Create Space"
  3. Create all 10 buckets listed above
  4. Come back and we'll proceed with upload

Alternative: Provide DO Spaces secret key and I'll create buckets programmatically:

export DO_SPACES_SECRET="your_secret_key_here"
# Then run Python boto3 script

📝 Commands Summary

Check handsofd push status:

curl -s -H "Authorization: token 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" \
https://api.github.com/repos/Independent-Business-Group/wordpress-handsofd/commits?per_page=1

List existing buckets:

s3cmd ls

Upload content after buckets created:

cd /tmp/wordpress-repos
for repo in wordpress-*/; do
site=$(basename "$repo" | sed 's/wordpress-//')
s3cmd sync "$repo/wp-content/" "s3://wordpress-${site}-content/wp-content/" \
--exclude 'cache/*' --acl-public
done

Update app env vars:

doctl apps list
doctl apps spec get {app-id} > app-spec.yaml
# Edit file
doctl apps update {app-id} --spec app-spec.yaml

Monitor deployment:

doctl apps logs {app-id} --follow