Black Friday: 40% off the first year. Until Sunday 29 November, code BLACKFRIDAY40.
ZeroBehind

Home / Guides

A standby server for WordPress: database and files

If you host WordPress sites for clients, a nightly backup answers the question of what you can restore. It does not answer how long the sites are down while you restore it. A second server that already holds everything does.

Two things have to arrive

A WordPress site is a database and a directory. The orders, posts and settings are in MariaDB. The uploads, themes and plugins are files. A standby with the database and without the uploads shows pages with broken images; one with the files and an old database loses yesterday's orders.

The database: never more than a moment behind

ZeroBehind drives MariaDB's own GTID replication. Every transaction the master commits is sent to the replica at once. The console shows how many transactions the replica is missing, and the usual answer is zero.

The whole server is replicated: every site's database, including the ones you add next month.

The files: every few minutes, to the same path

You choose the directories, for example each site under /var/www. The replica pulls them from the master every 5, 15, 30 or 60 minutes, through the same encrypted channel, to the same path. Owner, permissions and times are kept. Caches, logs and upgrade leftovers are left out by default.

The console shows when each directory was last copied, how big it is and how every run went. Before a planned role switch the files are copied once more, so the new master starts with what the old one had.

What protects the copy

A tool that mirrors files will also mirror a mistake. These stops are built in:

The day you need it

For planned work you switch roles: 3.5 seconds, with a pause for the application of under half a second on our own pair. After a failure you confirm the takeover, and the console tells you how many transactions may not have arrived and what time the files are from. Then you point the sites to the second server.

It is a standby, not a backup. Keep your backups: replication copies a deleted post as faithfully as a new one.

Want to see it on your servers?

Tell us what you run. We answer with what is covered and what is not.

Talk to us

Read next