Case Study

Moving an OpenCart store off failing hardware: a /boot trap, three database passes and a cutover that overran

An online store with two language storefronts had to leave a server that was losing disks and rebooting on its own. We rebuilt it behind Cloudflare, HAProxy and Varnish on new virtual machines. Two problems sat in the template before we started, and the cutover took 1 hour 42 minutes, against the 21 to 28 minutes we had rehearsed. This is where the time went.

November 2026  ·  7 min read

SECTOR

Online retailer, two language storefronts on one OpenCart install

SCALE

4.66 GB database, 186 tables, about 34 GB of files

PLATFORM

Cloudflare, HAProxy, Varnish 7.6, nginx, PHP 8.3, Valkey, Percona Server 8.4, SELinux enforcing

ENGAGEMENT

Migration off failing hardware onto a cached edge

321 → 676 MB

Free space on /boot before the first kernel update, after clearing template leftovers

452–459 s

Database import on every cutover pass, as rehearsed

17 / 17

Row checks matching old and new before the switch

Environment

The cutover, in minutes from maintenance mode onMinute 0: the storefront goes into maintenance mode. Minute 38: the first database pass, but staff edits in the old admin change three tables during the import. Minute 51: a second, guarded pass, but edits land again and the next two attempts are stopped by the guard. Minute 63: a third pass completes cleanly, then a courier API call writes three rows on the old server just after the dump and they are copied across by primary key. Minute 74: all 17 row checks match. Minute 77: SELinux blocks PHP's outbound HTTPS and the stock sync fails until a boolean is set four minutes later. Minute 97: Cloudflare is switched to the new edge. Minute 102: maintenance mode is lifted, and the first new order arrives at minute 105.The database took 7.5 minutes every time. Everything around it took the rest.MINUTE 0Maintenance onstorefront closedMINUTE 38Pass 1admin edits mid-importMINUTE 51Pass 2, guardededits again, 2 abortsMINUTE 63Pass 3 clean+3 late rows copiedMINUTE 7417 / 17 matchold and new agreeMINUTE 77SELinux blockoutbound HTTPS, 4 minMINUTE 97Cloudflare switchorigin to new edgeMINUTE 102Store openfirst order at 105Rehearsed: 21 to 28 minutes. Actual: 1 hour 42 minutes, with the storefront on a maintenance page throughout.

Scroll the diagram sideways to see all of it →

Minutes are counted from the moment the storefront went into maintenance mode. Red steps are the ones the rehearsals did not include.

The brief

A store on a server that was failing. The old server had rebooted itself twice in two days with nothing in its logs, and one disk of its mirror had not come back. The store ran OpenCart with two language storefronts, a 4.66 GB database and about 34 GB of product images and code. The new design put an edge VM in front, with HAProxy for TLS and Varnish caching the storefront, and a web VM behind it running nginx, PHP and the database, with Cloudflare in front and SELinux enforcing throughout.

Before the build

The template had a small /boot and a full one. The new VMs came from a cloud template with a 960 MB /boot that was already two thirds full on delivery: 321 MB free, partly taken by two rescue images that belonged to no installed kernel. A kernel update needs about 400 MB there, because dracut builds a new boot image for the host. On the first update, one VM ran out of space mid-update and was left with its default kernel but initramfs:MISSING, so it would not have booted. We cleared the leftovers, rebuilt the image with dracut -f and checked it with lsinitrd. A second VM did not come back after its update reboot. It was not live yet and we had no console capture, so we cannot say for certain that /boot caused it. It was rebuilt and put through the same clean-up first. Cleared properly, /boot went from 321 to 676 MB free before any update. Clearing /boot to at least 600 MB is now the first step on any VM from that template, and we reported the defect to the template’s owner.

Two rehearsals caught two more. The database moved from MariaDB 10.11 to Percona Server 8.4. The first import stopped after 443 seconds with ERROR 1101 ... TEXT ... can't have a default value: one TEXT column carried a default that MySQL 8 refuses. The import now converts it to VARCHAR on the way in. Testing the cache found that the rule passing logged-in visitors around Varnish matched OpenCart’s usual session cookie names, but this store had renamed its cookie with a prefix. A request carrying the real cookie came back as a cache HIT, so a signed-in page could have been cached. The match was widened before go-live, and the rehearsals put the cutover at 21 to 28 minutes.

Maintenance mode closed the store to customers, but not to the store’s own staff or to the systems that called it.

Where the cutover time went

The database was never the slow part. Every import took 452 to 459 seconds, as rehearsed. The time went on everything around it. The admin stayed open. OpenCart’s maintenance mode closes the storefront, not the admin, and staff were still saving product edits on the old server during the first import, so three tables differed afterwards. We added a guard that aborts the dump if the source changes. Edits landed during the second pass as well, and the guard stopped the next two attempts. Other systems kept calling. A scheduled job on another server was still calling the live site, and we found and disabled it during the window. The third pass completed cleanly, but a courier API call wrote three rows on the old server just after the dump. We copied those three rows across by primary key, after backing up the new server’s own row, and all 17 row checks then matched. SELinux blocked outbound HTTPS. The ERP sync job failed with a login error because SELinux stops PHP from opening outbound connections by default. We set the httpd_can_network_connect boolean, with SELinux still enforcing, and the sync returned real data four minutes later.

At a glance

Challenge

Move an OpenCart store with two storefronts off a server with a failing disk mirror, onto new VMs behind a cache.

Approach

Clean the template first, rehearse the database twice, guard the dump against changes, then one Cloudflare switch.

Result

Live on the new stack with 17 of 17 row checks matching. The cutover took 1 h 42 min against 21 to 28 rehearsed.

After the switch

  1. Orders: the first new order arrived three minutes after maintenance mode was lifted, and 19 had come in within eleven minutes, with card and pay-later callbacks reaching the new server
  2. Image uploads: the image folder was labelled read-only for the web server, so admin uploads were refused for about an hour. We gave the catalogue folder a persistent writable SELinux label and blocked PHP from running under the image path in nginx. The fix was verified with a test write, before the next real upload
  3. MySQL 8 in the store’s own code: a banner edit page and a stock-reminder job used MySQL 8 reserved words without quoting them, and failed. We traced both for the store’s developers, and the banner page was fixed the same afternoon
  4. Old jobs off: the nightly file sync to the new server and the old server’s scheduled jobs were disabled, so nothing ran twice
  5. Rollback kept ready: the old origin stayed valid for 72 hours, with a plan to reconcile any orders if we had to go back

Outcome

A clean move, and an honest overrun. The store runs on the new stack with its cache in front, SELinux enforcing, and a database that matched the old one row for row at the switch. The cutover still took four times as long as rehearsed, with the storefront on a maintenance page throughout. The rehearsals measured the database correctly and missed the people and systems around it. The lesson: maintenance mode is not a write freeze. Before a final dump, close the admin, stop every external caller, and run the guard that proves the source has stopped changing, then rehearse with all of that in place. And check /boot on a new template before its first kernel update, not after.

More case studies

99 cPanel Accounts Moved to CloudLinux

36 min to transfer 99 accounts and 178 GB

41 GB WordPress News Site Migration

76,548 posts, the same count on both servers

NGINX Limits Ignored Under SELinux

1,024 → 65,000 open files per worker, verified live

Moving a store you cannot afford to lose orders on?

We rehearse the move, prove the data matches before the switch, and plan for the staff and systems that keep writing while you migrate.