Skip to content

Stream-First Backups: Never Run Out of Memory

·

Most WordPress backup plugins load entire files into memory. On a 2GB site with 128MB PHP memory limit, that fails. Gratis Backup uses chunked streaming — it never holds more than 64KB in memory at once.

How it works

The backup engine uses PHP generators to stream file contents in 64KB chunks. Each chunk is hashed as it passes through, giving you integrity verification without a second pass over the data.

$ wp gratis-backup run --type=themes
Backing up: themes...
  100 files processed...
  200 files processed...
  300 files processed...
  400 files processed...
Success: themes: 485 files, 14.52 MB in 0.06s

$ wp gratis-backup list
ID                        Source    Files  Size     Created
20260525-themes           themes    485    14.5 MB  2026-05-25T07:41:50+00:00
20260525-database         database  1      0.1 MB   2026-05-25T07:41:46+00:00

Pre-update snapshots

Before any plugin or theme update, Gratis Backup automatically creates a database snapshot. If the update breaks something, you have a restore point. This happens silently — no configuration needed.

The backup never blocks the update process. If the snapshot fails for any reason, the update proceeds normally.

Share this post: