You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicfunctionactionBackup(?string$path = null): int
As the database dump can be quite big this can require a lot of diskspace. A better solution would be gzip, where the compression can be made on the fly. Therefore I suggest an additional option --gzip for dumps with gzip-compression.
For example for MySQL:
Backup: mysqldump ... | gzip -c > backup.sql.gz
Restore: zcat backup.sql.gz | mysql ...
For MySQL first the schema is dumped and then the data. With gzip the compressed output can simply be concatenated: mysqldump ... | gzip -c > backup.sql.gz && mysqldump ... | gzip -c >> backup.sql.gz
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
For backups CraftCMS dumps the database and then compresses it, if the zip-option is set:
cms/src/console/controllers/DbController.php
Line 168 in 203ebf0
As the database dump can be quite big this can require a lot of diskspace. A better solution would be gzip, where the compression can be made on the fly. Therefore I suggest an additional option
--gzip
for dumps with gzip-compression.For example for MySQL:
mysqldump ... | gzip -c > backup.sql.gz
zcat backup.sql.gz | mysql ...
For MySQL first the schema is dumped and then the data. With gzip the compressed output can simply be concatenated:
mysqldump ... | gzip -c > backup.sql.gz && mysqldump ... | gzip -c >> backup.sql.gz
cms/src/db/mysql/Schema.php
Lines 200 to 214 in 203ebf0
Beta Was this translation helpful? Give feedback.
All reactions