Reducing downtime during Magento Open Source releases starts with what runs in the window
This page covers how to shorten the maintenance window on a self-hosted Magento Open Source store by deciding what still has to run on production during a release. The main levers are moving code compilation and static content builds off the production system, using setup:upgrade --keep-generated so previously generated code is not thrown away, and allowing staff IP addresses through maintenance mode so the team can verify the release before customers return. A long window usually means that dependency installation, dependency compilation, static content deployment and the upgrade steps all run on the live server while the store is closed. Teams feel this most when the catalog is large, the extension count is high, or the store is customized enough that a full compile takes a meaningful part of the window.
Before changing anything, list each step your current release runs and mark whether it needs production files, production data or only the built artifact. Composer installs, setup:di:compile and static content generation usually depend only on the code, so they can run on a build server and ship as a tested artifact. Database schema and data patches must run against the production database, and they are the steps that set the real floor on window length. Confirm with your own timings from the last two or three releases which steps dominate. Also confirm which Magento version and PHP build your store runs, because the supported combinations in Adobe's system requirements determine whether your build server must match production exactly.
None of these levers removes the need for a tested rollback, a current database backup and a verification pass after the store reopens. A shorter window does not make a risky schema change safe, and staff access through maintenance mode only helps if the people using it have a written checklist for what they test. Ask your partner or internal team to show the release timing broken down by step, the exact artifact that moves between environments, and the rollback point if an upgrade step fails partway through. Any figures for expected window length should come from measured timings on your own store, not from generic estimates.
How a release moves from build server to production
The release starts on the build server, which compiles code and static assets from the tagged source. The build artifact then moves to production, where maintenance mode is enabled and only the import and upgrade steps run. Staff IP addresses are allowed through maintenance mode for verification, and the store reopens once checks pass. Only the steps inside the window add to customer downtime, so the work to move off production is what shortens it.
Compilation runs before the window, while only import and upgrade steps run inside it.
Which release-downtime options fit which store
This table compares four levers for shortening Magento Open Source maintenance windows, covering what each one cuts from the window, what it requires and when it fits. Read it by matching your store's build time, team setup and tolerance for downtime to a row, then combine levers where the requirements allow. The main takeaway is that moving compilation off production and allowing staff IPs through maintenance mode are the lowest-effort starting points, while a full build-and-deploy pipeline is the option that removes the most work from the window.
| Lever | What it shortens | What it requires | When it fits |
|---|---|---|---|
| Compile on production (default upgrade flow) | Nothing; it is the baseline that runs setup:di:compile and static content deployment inside the window | No build tooling beyond the store itself | Small catalogs with low traffic where a longer window is acceptable and the team has no build server |
| Off-production compilation | Dependency install, DI compilation and static content generation move out of the production window | A build host with the same PHP, Composer and Magento versions, and a way to move the built code to production | Stores that want shorter windows without changing how releases are approved or rolled back |
| setup:upgrade with --keep-generated | Avoids regenerating generated code on the production run, so the upgrade step itself does less work | Generated code produced on a matching build, and a clear rule for when a full regeneration is still required | Releases where code and static assets were built and tested before the window and no DI or static changes need a fresh compile |
| Allowing staff IPs through maintenance mode | Customer-facing downtime, since staff can verify the release on the live stack before the window closes | An allowed IP list maintained in the deployment, and a smoke test checklist staff run before reopening | Stores with internal sales or support teams who need to check the release in the production environment |
| Full build-and-deploy pipeline | Most production-side work, since code, assets and generated files are built on a build server and only import and upgrade steps run on production | Separate build and production systems, committed shared configuration, artifact versioning and a tested rollback path | Teams with frequent releases, several environments or a need to keep production changes repeatable and auditable |
| Ask your partner or team to confirm | The actual window length on your hardware, since no timings are published in this guide | A timed rehearsal of each lever on a production-like copy of your store | Before you commit to a lever, compare results from a rehearsal rather than estimates |
How to set up a shorter release window step by step
This sequence moves compilation and static content work off production, so the maintenance window covers only the database upgrade, verification and the switch back to live traffic.
Confirm version and stack compatibility
Before anything else, the release owner checks that the target Magento Open Source version, the PHP version, the database (MySQL or MariaDB), OpenSearch, Redis or Valkey, RabbitMQ, Composer and nginx on both the build server and production all appear together in a combination Adobe supports for that release. Adobe's system requirements list the supported combinations for each release, and the team should confirm them against the exact patch level they plan to ship. Done means a short written checklist, signed off by the release owner, that matches the requirements page line by line. Any mismatch between build and production blocks the release until it is resolved.
Build code and static assets on the build server
The build engineer runs the Composer install and the static content deploy on a dedicated build server that matches production's PHP and extension set, so the compiled output is produced once and not on each live node. Generated code and static files are created here, not on the storefront. Done means the build finishes without errors, the static content and generated directories are populated, and the build is tagged with the commit hash it came from.
Package and ship the verified artifact
The engineer packages the built application, including the generated code and static content, into a single artifact and copies it to production with the shared configuration files managed separately. The artifact is checksummed, and the checksum is compared on the production host before the release is activated. Done means the checksum matches on every node that will receive the release, and the previous artifact is kept available for rollback.
Enable maintenance mode with allowed staff IPs
Just before the database work begins, the operator turns on maintenance mode and lists the staff IP addresses that should still reach the storefront and admin, so the team can verify the release from inside the maintenance window. Shoppers see the maintenance page while the upgrade runs. Done means a request from a listed staff address loads the store, and a request from any other address shows the maintenance page.
Run setup:upgrade with keep-generated only when safe
The operator runs bin/magento setup:upgrade. The --keep-generated flag is added only when the release owner has confirmed that no generated code (such as interceptors, proxies or factories) has changed since the build, for example because no module or dependency injection configuration changed in this release. If there is any doubt, the flag is left out so generated code is rebuilt. Done means the command completes without errors and the output shows the schema and data updates applied. Confirm the flag decision in the release log.
Verify the release from staff addresses
With maintenance mode still on, the QA lead tests the storefront, checkout, the admin panel and any integrations, such as payment, shipping or ERP connections, using a staff IP address. The operator also checks the cache state, indexer status and the logs for new errors. Done means every test in the pre-agreed checklist passes, and the log review shows no new critical errors. If a check fails, the team rolls back to the previous artifact rather than leaving the release half-applied.
Disable maintenance mode and watch the first traffic
Once verification passes, the operator disables maintenance mode, clears or warms caches as the release plan requires, and monitors the store for the first period after reopening. The team watches error rates, checkout completion and log output against the baseline taken before the release. Done means the store serves regular traffic, the monitoring stays within the baseline, and the release owner records the completion time in the release log.
What changes for the operations team, the developers and the store owner
Operations owns the window itself: when maintenance mode starts, which steps run in which order, how the store is verified, and how a failed release is reversed. Shortening the window depends on moving compilation off production and keeping the upgrade steps short and predictable, so operations must agree the sequence with developers before the first release is attempted.
- Window sequence: Write the exact order of maintenance mode, code switch,
setup:upgrade --keep-generatedand cache flush, with a named owner for each step. - Staff access during maintenance: Confirm which staff IP addresses are allowed through maintenance mode and test that the allow list works before the window opens.
- Rollback path: Keep the previous release build and a database backup point that can be restored within the agreed window, and rehearse the reversal on a staging copy.
- Monitoring during and after: Watch web server errors, PHP-FPM status, queue and cron health, and storefront checkout paths for the first period after the window closes.
- Evidence: Record start and end times, each command output and any deviation so the next window can be planned from real data.
Before the next release, check that the runbook matches the current build pipeline and that the rollback has been timed on a copy of production data.
Developers decide what goes into the release and whether generated code can be carried across the switch. Using setup:upgrade --keep-generated skips regenerating code that already exists, which only works when the generated classes, proxies and compiled DI definitions still match the source. Developers must know which changes invalidate that assumption, because a stale generated file can break the store in ways that only appear under real traffic.
- Generated code: Run
setup:di:compileand static content deployment in the build pipeline, not on production, and store the output with the release artifact. - Module and schema changes: Treat any change to dependency injection configuration, plugins, layout XML or declarative schema as a reason to run a full compile, not a keep-generated upgrade.
- Unsafe cases: Avoid keep-generated when the release changes PHP versions, module load order, or code that generated proxies or factories depend on.
- Build parity: Use the same PHP version, Composer lock file and extension set in build and production, so the artifact behaves the same on both sides.
- Test evidence: Run the upgrade on a copy of production configuration and confirm that the front end, admin and checkout still load after the switch.
Before each release, confirm the changed file list against the list of generated and schema-affecting paths, and check the Adobe documentation for the exact commands in your release line.
The store owner decides when a window can happen and what it costs in lost orders, delayed promotions and customer support load. The owner does not run commands, but needs a clear statement of how long the store will be unavailable, which customers and channels are affected, and what happens to orders placed near the window edges. Without that statement, approval becomes guesswork.
- Expected window: Ask the operations lead for a planned duration and a worst-case duration, and for the criteria that trigger a rollback.
- Sales impact: Agree the lowest-traffic period with marketing and finance, and confirm how carts, promotions and scheduled price changes behave during maintenance.
- Customer communication: Approve the message shown during maintenance and the channels used to inform regular buyers and business accounts.
- Approvals: Sign off the release before the window and the go or no-go decision at the window start, with a named person who can make the call after hours.
- Post-release review: Receive a short report covering actual duration, orders affected and any incidents, so the next window can be scheduled more accurately.
Ask your implementation partner or internal team to put the expected window, rollback triggers and approval steps in writing before the first planned release.
Security risks of allowing staff through maintenance mode
Letting staff IPs through maintenance mode keeps the admin reachable while the storefront is closed, but it also opens a path that normal traffic does not use. The cards below cover the risks that appear during a release window and the checks that keep them small, with links back to the admin hardening and file permission controls in this group.
Stale IP allowlists
The staff IP list used for maintenance mode is often copied from an old runbook and never reviewed. A former contractor's address, a retired VPN egress or a home connection can still be on it weeks later. Before each window, compare the list against current VPN and office egress ranges, remove any address without a named owner, and record who approved each change. Keep the list in version control so removals are visible.
Exposed admin path during the window
While maintenance mode is on, the admin login is the only dynamic entry point left open to the allowed addresses. If the admin path is still the default admin value, anyone who can reach the server through an allowed range, or who spoofs a forwarded address behind a misconfigured proxy, has a predictable target. Confirm that the random admin path from the install is in place, that the web server trusts forwarded headers only from your load balancer, and that admin two-factor authentication is enforced before the window opens.
Credentials in build artifacts
Pipelines that compile code and static assets on a build server produce artifacts that are copied to production. If the build step reads auth.json, repository keys or a populated env.php, those secrets can end up inside the archive or in logs. Confirm that the artifact contains only compiled code and generated files, that credentials are injected on the production node at deploy time, and that build logs are scanned for key patterns before they are retained.
File ownership changes during the release
A release that runs as the wrong user can leave generated code, var and pub/static files owned by a different account, or can require the web user to write into directories it should never touch. Those shortcuts are how weak permissions turn into a compromise path. After each deployment, check that code directories are not writable by the web server user, that only the directories the store must write to are, and that setup:upgrade --keep-generated did not change ownership of files it regenerated.
Cache and session exposure
Maintenance windows are when caches are flushed, indexers rebuild and sessions are reset. Cached pages rendered for a staff IP can be served to customers if a full-page cache or proxy keys responses without the right variation, and session data can be shared across nodes in unexpected ways. Before opening the window, confirm how Varnish or your load balancer handles the maintenance bypass, that cached responses for staff are not reused for public traffic, and that sessions survive the cache flush as expected.
Restoring maintenance mode after a failed check
If a post-deploy smoke test or health check fails, the store must return to maintenance mode quickly, and the allowlist must not stay wider than it should. Write the rollback step before the window starts: who runs it, which command closes the store, and how the staff allowlist is reverted. Rehearse this on a staging system so the team knows the steps work under time pressure and that a partially upgraded store is not left open to customers.
Questions teams ask before reducing release downtime
What drives the cost of splitting a Magento release pipeline?
The cost depends mostly on how much build work already exists and how many environments need to change. A split usually means a build server or CI job that compiles code and static assets, an artifact that moves to production, and a production step limited to import and upgrade commands. Costs fall into one-time work (pipeline design, build scripts, a staging rehearsal) and recurring work (keeping the build image, PHP and extension versions aligned, and maintaining the deploy job). Ask any partner to price these components separately in the written scope, and ask who owns the build server after handover.
How long does a release downtime reduction project take?
Duration depends on the number of environments, the size of the custom code base, how many third-party extensions must be tested against the new build flow, and whether shared configuration already lives in version control. Teams with a working staging environment and a documented release checklist usually move faster than teams starting from manual production deploys. No fixed duration applies to every store, so ask for a timeline tied to the agreed scope and to a rehearsed release on staging before production use.
What does the team need to provide before the work starts?
The team should provide access to the code repository, the staging and production environments, and the current deployment steps as they really run today. They also need a list of installed extensions and their versions, the current maintenance window and approval process, and a named person who can approve changes to shared configuration. Early access to a non-production copy of the database helps the team test the upgrade step realistically. Confirm these items with your own engineers before scoping starts.
Can an in-house team reduce Magento release downtime without a partner?
Yes, if the team already runs Magento Open Source with Composer, has version control for shared configuration, and can rehearse releases outside production. The work is mostly pipeline engineering and disciplined release steps, not new Magento features. A partner adds value when the team lacks capacity, when extensions make the build flow hard to reproduce, or when the team wants an independent review of the release sequence. Compare the internal effort, including on-call time for failed releases, against a written partner scope.
What does --keep-generated change during setup:upgrade?
The --keep-generated option tells setup:upgrade not to delete the generated code directory, which lets production skip some regeneration work when compiled code was built elsewhere. It shortens the upgrade step only when the generated files match the deployed code and configuration. Confirm the exact behavior and supported flags for your release line in the Adobe documentation before you rely on it in a runbook.
When is using --keep-generated unsafe?
It is unsafe when the generated code on production does not match the code, modules, themes or configuration being deployed. Typical causes include a build server running a different PHP version, an extension changed without a fresh compile, a theme or static asset built from an older commit, or a partial file copy during release. Using it after a Magento patch or a PHP upgrade also needs a fresh build. Always run a rehearsal on staging, check the deployed version, and keep a rollback path before enabling it in production.
Which staff IPs should stay allowed during maintenance mode?
Allow only the fixed office, VPN or bastion addresses that staff use to verify the release, and keep the list short and reviewed. Adding entries lets engineers and support check the store while public traffic sees the maintenance page. Remove the entries after the release and record the change in the release log. Confirm the exact configuration method for your version in the Adobe documentation, and avoid listing broad address ranges that would weaken access control.
Does a faster release window affect PCI DSS scope or security?
A shorter window does not change PCI DSS scope on its own, but the pipeline changes can. If build servers, artifact stores or deploy credentials handle cardholder-adjacent systems or secrets, they may fall within the assessed environment. Keep deploy credentials out of the repository, restrict who can run production steps, and log every release. Discuss the scope with your qualified assessor, because only independent assessors can confirm it.
Where shorter windows trade off against risk and effort
Shorter maintenance windows are not free. Moving compilation to a build server removes work from production, but it adds a machine you must provision, patch, secure and keep in step with production. Credentials that let the build server pull auth.json keys, push artifacts and reach the release target become another access path to protect, and someone must own that access after the project ends. Before committing to a separate build system, confirm who will administer it, how its artifacts are signed or checksummed, and how a failed build is rolled back without touching the live code.
The time saved by setup:upgrade --keep-generated depends on whether the generated code actually changed. If a release changes plugins, di.xml definitions, or the set of compiled classes, the kept files may be stale and the store can fail in ways that only appear under load. Treat the shortened window as conditional: run the same release against a staging copy with a production-like database, compare generated output with what was built, and keep the full compile path documented as the fallback. Your own staff should also understand which release types can skip compilation, since that decision is easy to get wrong under deadline pressure.
Allowing staff IP addresses through maintenance mode trades a short verification period for exposure. Any address on the allow list can reach a storefront and admin surface that customers cannot, so the list should be short, reviewed for each release, and removed immediately afterward. Confirm that admin two-factor authentication and access logging are active during that window, because a partially upgraded store is a poor place to discover a gap. How often you release also changes the value of this work. Adobe's release schedule says security patches ship at least annually for supported lines, and its upgrade guide recommends applying every patch cycle to stay secure and PCI compliant. If you patch only once or twice a year, a few extra minutes per window matter less than getting the process right. If you patch every cycle, the time saved compounds and the build pipeline pays back faster.
How DeployOpen scopes a release-downtime engagement
A release-downtime engagement follows a fixed sequence, and each step produces something you can review before the next one starts. The steps below connect the current release process, the proposed build and deploy sequence, and the evidence you receive at handover.
Written scope and quote
The engagement starts with a written scope that names the stores, environments, release cadence and the maintenance window you want to shorten. The quote follows from that scope, so the cost reflects the work you agreed to, not an estimate. Ask the proposal to state which steps run on production, which run on a build system, and who approves each change.
Review of the current release process
DeployOpen reviews your existing release steps, including where Magento compiles code and static assets, which commands run in maintenance mode, and how long each step takes today. The review also checks your Adobe Commerce or Magento Open Source version and its support dates. Ask for a timed log of the last few releases so the review starts from measured data, not memory.
Proposed build and deploy sequence
Based on the review, DeployOpen proposes a sequence that moves compilation and static content generation off production and limits production to the import and upgrade steps. The proposal lists the commands, the setup:upgrade --keep-generated decision and the rule for allowing staff IP addresses through maintenance mode. Check that the sequence includes a rollback path for each production step.
Verification on a staging copy
The proposed sequence runs on a staging copy built from production data and configuration. The test run measures the production-side window, confirms that the storefront, admin and background jobs work after the switch, and checks that generated code matches the deployed release. Ask for the timed results and the list of failed checks, along with the fixes applied before the production run.
Handover and documentation
At handover, your team receives the runbook, the pipeline configuration, the maintenance mode procedure and the verification checklist. Engineers from your side run one release with DeployOpen observing, so the process is tested by the people who will own it. Confirm that the handover includes the staging copy setup and the list of settings kept outside Git.
Retainers for ongoing releases
Releases continue after handover, and each Magento patch cycle needs the same steps repeated. A retainer covers the ongoing release work, including upgrades to new patch versions and changes to the pipeline as modules are added. Ask what the retainer includes, how release requests are prioritized and how emergency patches are handled outside the normal cycle.
How DeployOpen works on this
DeployOpen scopes release downtime work for Magento Open Source against your own pipeline, hosts and maintenance practices, then builds and documents the change inside your infrastructure. The result is a release process your team can run without us, with a retainer available if you want continuing help.
How we scope
- Review your current release steps, build location, and the time your store is in maintenance mode on each deploy.
- Agree in writing which pipeline stages move off production and which staff IP addresses are allowed through maintenance mode.
- Confirm the exact Magento Open Source version and the PHP, MySQL or MariaDB, OpenSearch, Redis or Valkey and nginx versions your store runs on.
How we build
- Set up a build stage that compiles code and static assets away from production, then test the artifact in a staging copy of the store.
- Configure the
setup:upgrade --keep-generatedstep and maintenance mode allowlisting, and check each change against a timed staging release. - Record each change in version control so the release sequence can be reviewed, repeated and rolled back by your own engineers.
How we hand over
- Deliver a written runbook covering the build, transfer, upgrade and maintenance mode steps, with the commands and the owner of each step.
- Walk your engineers through a full release on staging, including what to do when a step fails partway through the window.
- Document the staff IP allowlist process and who approves changes to it, so access stays controlled after handover.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer, covering changes to the release process as your store grows.
- Review each Magento Open Source patch cycle against the release schedule and your build pipeline before it reaches production.
- Confirm with your team which support terms, response expectations and service levels apply before signing, since these are set in the written agreement.

