Google Cloud | Migration

Why Think About Migrating WordPress Sites to Google Cloud

Dheeraj Panyam
Dheeraj Panyam

Running WordPress on a small VPS or a bare-metal server works fine until it doesn’t. Spikes in traffic, aging hardware, rising power or colocation costs, and manual patching all start to hurt. Google Cloud Platform (GCP) gives you on-demand capacity, global load-balancing, built-in backups, and a pay-as-you-go bill. In short, the platform lets you spend less time firefighting and more time building features.

In this article I’ll walk through three practical migration paths I’ve used with real customers:

  1. Re-host (Lift-and-Shift) VM to VM
  2. Google Cloud Marketplace Deployment Click-to-Launch (SaaS Solution)
  3. Deploy WordPress sites on GKE (DIY + Modernization option)

For each path I’ll outline when it shines, the high-level steps, and the trade-offs you should know before you hit “migrate.”

Decision Matrix

Requirement Re-host VM Marketplace GKE
Migration speed Fast Fast Moderate
Hands-on control Full Medium Full (infra as code)
Autoscaling Manual Limited (MIG) Native
High availability DIY Optional (HA template) DIY or Migrate to
containers
Op-ex savings at scale Low Medium High
Learning curve Low Low High

1. Re-host: Lift and Shift Your VM

Best for:

  • Tight deadlines (“we need to move this week”)
  • Minimal change tolerance (keep OS, PHP version, file paths the same)
  • Teams comfortable managing Linux but new to cloud

What it looks like

You snapshot the existing Linux instance Apache/Nginx, PHP-FPM, MySQL or MariaDB then restore that image on a Compute Engine VM. From the outside nothing changes: same WordPress files, same database engine, same plugins. Under the hood your disk now lives on a resilient Google Persistent Disk, and you can resize CPU/RAM with one click.

Core steps

  1. Audit and clean up
    • Remove old backups, log files, and test plugins to shrink the disk image.
  2. Full backup
    bash
    # On the source servertar czpf /tmp/wp-backup.tgz /var/www/html /etc /var/lib/mysql
    mysqldump -u root -p --single-transaction --all-databases > /tmp/db.sql
  3. Export to Google Cloud Storage
    • Use gsutil or rclone over an SSH tunnel.
  4. Create a matching VM
    • Same distro version, same storage size.
    • Add a static external IP if you plan a DNS cut-over.
  5. Restore files and DB
    • Re-install packages, copy files, import the SQL dump.
  6. Update DNS / load balancer
    • Point traffic at the new IP, or place the instance behind Cloud Load Balancing.

Pros

  • Fast: hours or days, not weeks.
  • Low learning curve: you keep familiar sysadmin tasks.
  • Rollback: flip DNS back if something breaks.

Cons

  • Same single-point-of-failure: one VM can still crash.
  • Manual scaling: you must size up or add more replicas by hand.
  • Legacy baggage: old PHP or OS versions come along for the ride.

2. Google Cloud Marketplace: One-click deploy SaaS Solution

Best for:

  • Green-field sites or small migrations that don’t need custom OS tweaks
  • Teams who want Google-managed updates and HTTPS out of the box
  • Faster time-to-value than a full container build

What it looks like

Open Marketplace, search “WordPress Certified by Bitnami,” fill a short form, and hit Deploy. Google spins up a Compute Engine instance (or optionally a MIG Managed Instance Group), configures Apache, PHP, and MariaDB, and enables HTTPS via Let’s Encrypt. The deployment manager script also creates a Cloud SQL instance if you choose the high-availability option.

Core steps

  1. Launch from Marketplace
    • Choose single-VM or HA setup.
    • Pick machine type and disk size.
  2. Secure the instance
    • Restrict firewall rules to 80/443.
    • Add Cloud Armor rules if needed.
  3. Migrate content
    • Use the All-in-One WP Migration plugin or WP-CLI to import your site.
  4. Swap DNS
    • Point your domain to the new load balancer IP (HA) or instance IP (single-VM).
  5. Set up backups
    • Enable Automated Backups on Cloud SQL or install snapshots on the boot disk.

Pros

  • Speed + Simplicity: point-and-click UI, no manual LAMP stack build.
  • Managed database (if you pick Cloud SQL): automatic patching and failover.
  • Blueprint updates: Bitnami regularly releases patched images.

Cons

  • Less control: stack layout and file locations follow Bitnami conventions.
  • VM bound: still a stateful instance unless you refactor later.
  • Cost: Cloud SQL + VM + load balancer can cost more than a DIY VM.

3. DIY to deploy to GKE or use Migrate to CLI tool to migrate your VM based WP sites to GKE

Best for:

  • High-traffic or multi-tenant WordPress (multiple sites)
  • Teams investing in DevOps / GitOps pipelines
  • Need for zero-downtime rolling updates and autoscaling

What it looks like

You break WordPress into:

  • A stateless container image (Apache + PHP + WP code).
  • A Cloud SQL or AlloyDB for Postgres instance for the database.
  • A PersistentVolumeClaim (PVC) or Cloud Storage FUSE mount for wp-content if uploads must remain writable.

GKE handles rolling updates, horizontal pod autoscaling, and self-healing. SSL termination happens at an Ingress backed by Cloud Load Balancing. CI/CD pushes a new container tag; GKE rolls it out with zero downtime.

DIY method

Core steps

  1. Assess plugin compatibility
    • Some plugins expect local exec access; test in Docker first.
  2. Containerize
    • dockerfile
      FROM wordpress:6.5-php8.2-apache
      COPY ./wp-content /var/www/html/wp-content

      Store the image in Artifact Registry.
  3. Build a Helm chart or Kustomize manifests
    • Deployment, Service, Ingress, Secret (DB creds), ConfigMap (wp-config.php).
  4. Provision Cloud SQL
    • Private IP + VPC-SC for secure traffic.
  5. Set up storage for media
    • Option A: RWX CSI driver with Filestore
    • Option B: Offload to Cloud Storage + plugin (Media Cloud, WP-Stateless).
  6. CI/CD pipeline
    • Cloud Build triggers on Git push, builds the image, bumps the Helm release.
  7. Cut over
    • Migrate DB with mysqldump or wp db export/import.
    • Sync media to the PVC or Cloud Storage bucket.
    • Point DNS to the Ingress IP or Cloud CDN hostname.

Migrate to containers (CLI based tool)

Google Cloud’s Migrate to Containers tool helps enterprises seamlessly replatform VM-based apps whether from VMware, Compute Engine, AWS, Azure, or on‑prem to container-native environments like Google Kubernetes Engine (GKE) or Cloud Run.

When using Migrate to Containers for WordPress, customizing the generated config.yaml migration plan is essential to ensure a smooth transition. This lightweight YAML file defines everything from container image details to volume mapping tailored for your specific needs.

Key Configuration Areas

1. Docker Image Setup
Adjust the fromImage field to specify which base image to use whether the default WordPress image or a customized alternative suited to your specific PHP version and extensions.

2. Database Connection Values
Edit the databaseValues section to inject correct credentials and host details. This ensures that once your containers are up, they’ll connect seamlessly to the WordPress database.

3. Persistent Volume Configuration
Customize the volumes section to persist content in wp-content. You can point to an existing PVC or define a new one (with size and accessMode settings), allowing WordPress content like plugins, themes, and uploads—to persist across container restarts .

Pros

  • Elastic scaling: pods scale to traffic; you only pay for what you use.
  • Rolling updates: no visitor downtime while deploying new code or patches.
  • Easier multi-site: run dozens of sites in one cluster, each as its own namespace.

Cons

  • Steeper learning curve: Docker, Kubernetes YAML, Helm, networking.
  • State management: you need a plan for media files and sessions.
  • Up-front effort: containerizing legacy plugins can surface hidden issues.

Cost Signals to Watch

  • Idle CPU & memory: Right-size Compute Engine with gcloud compute instances list –format=’value(name, cpuPlatform, machineType, status)’.
  • Egress traffic: Put Cloud CDN in front of images and CSS.
  • Persistent disk vs. Filestore: For heavy media uploads, Filestore may save IOPS costs.
  • Long-running dev/test sites: Shut them down with a Scheduler + Cloud Functions script.

Hard-won Tips

  • Start with backups: Even tiny sites have irreplaceable media. Cloud Storage Standard is cheap insurance.
  • Match PHP versions during cut-over to avoid “white screen of death.” Upgrade after you stabilize.
  • Use Cloud DNS with low TTL (60 s) before migration so rollbacks are painless.
  • Plan for SMTP: Local mail() calls break on GCP. Use SendGrid, Mailgun, or Google Workspace SMTP relay.
  • Turn on Cloud Monitoring right away. You’ll want real dashboards when traffic spikes at 2 a.m.

Conclusion

You don’t have to refactor everything on day one. A lift-and-shift buys you time, Marketplace gives you a quick win with sensible defaults, and GKE lays the foundation for future growth. Pick the path that matches your schedule, budget, and team skills.
Need a second set of eyes on your migration plan or a hands-on crew to run the whole move? Reach out and we’ll migrate your WordPress.