New production deployment for existing (old) trellis project

Dear community!

I have an existing Trellis project that I’m modernizing. After upgrading my MacBook, I’ve successfully migrated to Lima for local development, which is working great.

Working:

  • Development environment (Lima setup)
  • Staging environment (provisioned and deployed successfully on new subdomain)
  • New site created within existing Trellis project structure

The problem: My production environment is currently:

  • Running the old site with the legacy deployment system
  • Using the same domain/URL that the new site needs to use
  • Hosted on a separate Digital Ocean droplet (Ubuntu 20.04)
  • Still serving live traffic

Question

I’m at a decision point for the production deployment strategy and would appreciate guidance on the best approach:

Option A: Create New Droplet

  • Provision entirely new Digital Ocean droplet
  • Deploy new site to fresh server
  • Update DNS to point to new server
  • Decommission old droplet after successful migration

Option B: Migrate Existing Droplet

  • Work with the current production droplet
  • Somehow transition from old deployment to Trellis on same server
  • Maintain same IP address

Considerations

  • Downtime: Minimizing downtime is important as this is a live production site
  • Data Migration: DB data will be migrated from the Staging Site via WP CLI and search-replace feature - No Uploads needed to migrate
  • DNS: Currently pointing to existing server IP
  • Rollback / Troubleshooting: Ideally, the whole process is revertible if the deployment keeps failing…

Questions

  1. What’s the recommended approach for this type of migration?
  2. If going with Option A (new droplet), what’s the best practice for handling the domain transition?
  3. If going with Option B (existing server), is it feasible to migrate from a legacy deployment to Trellis on the same server?

Kind regards, Dominik

Hello!

I did a similar move about a year ago.

Sage 9 in Docker → Sage 9 in Trellis (Later upgraded to Sage 10). Worth every second IMO. We had issues with Docker screwing up WooCommerce among other things.

I did option A, except I used Hetzner instead of Digital Ocean. More bang for the back that way, for sure.

If your site is using Cloudflare, then the domain transition should be close to instantaneous, if not I’d suggest letting the original server stay up until you’re absolutely certain that 100% of the traffic is reaching the new site rather than the old site. Should be about 72 hours, at most.

What type of site is it? Is it a mostly read only site or a very interactive site?