• Formerly Platform.sh
  • Contact us
  • Docs
  • Login
Watch a demoFree trial
Blog
Blog
BlogProductCase studiesNews
Blog

Production clone in 45 seconds with data, files, services, everything

developer workflowCI/CD
06 November 2025
Share

Watch the time-lapse demo below before you read on. It takes less than a minute to see how you can spin up a production-clone environment in under a minute… with the database, files, and services all included.

And here’s why that changes everything for developers.

You know the feeling. A regression slips past staging, customers feel it first, and your afternoon (or late night) becomes a post-deployment war room. Developers report spending most of their time on reactive work, such as debugging and war rooms, rather than building new software.¹ No wonder releases feel harder than they should.

This walkthrough shows how Upsun’s “production clone” turns any Git branch into a production-perfect environment in under a minute, with data, files, and services cloned from the parent. You can reproduce issues, validate fixes, and prove performance before merge. No more post-deployment fire drills.

The problem: environment drift and brittle testing

Staging rarely matches production. Different service versions, missing data, developers pushing different versions of the code, or out-of-date assets create environment drift that hides real bugs until go-live. AWS’s DevOps guidance recommends baselining environments and continuously managing drift.²

Preview environments help, but only when they are truly “like prod.” That means:

  • Same applications, build, routes, and infra settings
  • Same services are provisioned the same way.
  • Fresh data and files.
  • Observability that flags problems early, not in a war room

Upsun solution: production cloning on every branch

With Upsun, every Git branch can become a live, production-grade environment with cloned services and code. You keep the familiar Git workflow you already use, now backed by instant, production-perfect previews that unblock reviews and debugging.

  • Git-driven YAML config. Define applications, services, and routes once in .upsun/config.yaml, commit to Git, and keep it versioned with your code (learn more in YAML structure).
  • Automatic previews per branch. Branching creates a child environment that inherits code, data, and assets from its parent. See the make changes guide.
  • Instant data cloning you can sanitize. Clone production data into the preview, then automatically sanitize it via deploy hooks, so reviewers never handle PII. See sanitize databases.
  • Multi-service orchestration. Provision managed databases, caches, search, and more from the same config file (see add services).
  • Observability and APM built in. Blackfire APM and profiling help you catch performance regressions before release (see Blackfire for PHP and PythonUpsun features).

How production cloning works in practice

1) One push creates a prod-clone

Use Git push on a new branch, and Upsun can activate a new environment, clone the parent services, and clone the parent’s data in one go.

This single push sets up a branch environment with production-identical filesystems and services, plus a cloned dataset from its parent. See manage environments.

Need to refresh data later? Keep your branch in sync with upsun env:sync data

2) Keep configuration simple and explicit

All apps, services, routes, and hooks live in .upsun/config.yaml. Here is a minimal example with a Node.js app, MariaDB, Redis, and a deploy hook that runs sanitization in non-production environments:

# .upsun/config.yaml
applications:
  web:
    type: "nodejs:22"
    relationships:
      mariadb: "mariadb"
      cache: "redis"
    hooks:
      deploy: |
        if [ "$PLATFORM_ENVIRONMENT_TYPE" != "production" ]; then
          ./scripts/sanitize_db.sh
        fi
services:
  mariadb:
    type: "mariadb:11.8"
  redis:
    type: "redis:7.2"  # persistent or ephemeral supported
routes:
  https://{default}/:
    type: upstream
    upstream: "web:http"
  • Services are declared in the same file and wired to the app via relationships (see database service example).
  • The deploy hook uses the documented environment variable PLATFORM_ENVIRONMENT_TYPE to vary behavior by environment and runs sanitization only on previews (see change hooks by environment).
  • Route config ensures your preview URLs are production-consistent (see Define Routes).

3) CI/CD testing that matches prod

Because branches are production-perfect, your CI pipeline can run against the same topology, versions, and data profile you will eventually deploy to production. That dramatically reduces flaky tests caused by environment drift. See build and deploy overview.

You can also add the Blackfire build feature to your pipeline to automatically detect performance issues and provide actionable recommendations for PHP and Python (Upsun featuresBlackfire on Upsun).

4) Safer application debugging with real data

Obscure, data-dependent bugs reproduce instantly when your preview carries real data and assets. Upsun’s sanitization guides demonstrate how you can safely remove PII in popular stack combinations, such as PostgreSQL and Django, Symfony and PostgreSQL, or MariaDB and Drupal (see "Sanitize PostgreSQL and Django," "Sanitize Symfony and PostgreSQL," and "Sanitize MariaDB and Drupal").

Would you prefer to work locally using production clone data? Tether your local environment to the remote services for quick iteration (tethered local development).

Why this improves developer productivity

  • Eliminate environment drift. Every branch is cloned from its parent, so parity is the default rather than an afterthought.³ 
  • Shrink feedback loops. Reproduce, instrument, and fix in the same place you validated your solution.
  • Cut rework and meetings. Fewer surprises in production means fewer war rooms and more time building.¹ ²
  • Stay consistent across teams. Git-driven YAML and managed services standardize delivery while preserving flexibility (Upsun docs home).

Put it together in your workflow

  1. Create a branch. The environment activates and clones data from the parent.
  2. Your sanitization code runs automatically on deployment in non-production environments.
  3. Your CI runs end-to-end and performance checks against the production clone.
  4. Reviewers test the real thing and sign off quickly.
  5. Merge with confidence, then monitor with Blackfire after release.

For a deeper dive into YAML patterns or multi-service setups, explore developer tutorials.

Who is this for? Developers who want to code more and spend less time firefighting. That is by design: Upsun provides each branch with a live, production-grade environment, allowing you to test, iterate, and review without the dread of “what if this breaks everything.”

Production cloning and environment drift

Use production cloning to remove environment drift from the conversation. When the environments are identical by default and carry safe, fresh data, CI/CD testing and application debugging feel honest again.

Try it yourself

Watching a prod-clone appear in 45 seconds is cool. Experiencing it with your own code is the real game-changer.

Spin up a free trial, connect your Git repository, and watch every branch come to life as a production-grade environment with data, files, and services included.

Sources

¹ Cisco Newsroom. “Developers spending more time firefighting issues than delivering innovation.”
² Stack Overflow Developer Survey 2024. “Daily time spent searching for answers/solutions.
³ AWS Well-Architected DevOps Guidance. “[AG.DEP.2] Continuously baseline environments to manage drift.” 

Stay updated

Subscribe to our monthly newsletter for the latest updates and news.

Your greatest work
is just on the horizon

Free trial
© 2025 Upsun. All rights reserved.