I’ve had a couple of restores/upgrades fail during migration due to space, in spite of there being multiple GB of space remaining (like Restore fails due to disk space on migration because of 70M calendar events).
Might doing a vacuum before backup help out with that issue?
Also
That’s
discourse=# VACUUM FULL ANALYZE;