Closed kthull closed 1 year ago
For a particular site [...] the resulting zip is corrupt
Hey @kthull, is this an issue only on the particular site (while on others the backup runs fine), or haven't you tested it on other sites?
I have not had the opportunity to test on other sites.
Thanks for your feedback. I've tried to reproduce the issue on a test site, and there the quick database backup using the defaults downloads a .gz
file which I could extract on Mac OS X without problems by opening it in Finder or using the gunzip
(NB: not unzip
) command.
I'm running into the same problem as @kthull . Files I download from the UI have a file name that ends in .mysql.gz
but are actually uncompressed .sql
files. They have not been gzipped. Do you think there might be an issue depending on the server? Maybe some servers can't zip the files, but still rename them anyway, as if they were compressed.
I'm not sure where to start on this. The setting for choosing "No compression" is located here. admin/config/system/backup_migrate/settings/profile/edit/default Perhaps the module defaults to gz compression unless manually changed?
Thoughts?
Or maybe it renames the files even if No compression
is set? I'll check my site and see what the value of that setting is. I'll also check on my server and see if we have gzip installed...
I can confirm this issue still exists. The downloaded file is a text file, not gzip, despite the extension
I can also confirm that, if you pick zip or bzip, the files are compressed correctly. Gzip seems to be the only one not working at all.
It looks like this the browser's fault. See: https://www.drupal.org/project/backup_migrate/issues/2926610
The issue there refers to Chrome, but this is happening in FF and Safari currently as well. Apparently the browser interprets the mime type as being compressed by the server for transmission, and decompresses the file (while keeping the extension). There is a suggested fix there that has not been committed. Any thoughts?
PR #88 submitted. Basically this follows the suggestion in the D7 queue, and changes the mimetype of the downloaded gzip file to octet-stream
. This prevents the browser from thinking that the server compressed the gzip file only for transmission. @jenlampton @kthull can you please test?
BTW, bzip and zip files are downloading fine in all my tested browser, without the need to change their mimetype before download.
Reopening while people test this.
Closing now that this PR is included in version 1-x.1.0.23
For a particular site I'm working on, running a quick backup of the database (all defaults) downloads the zip file correctly, but the resulting zip is corrupt with the following errors:
.gz
file becomes a.cpgz
file which cannot be unzippedunzip
command results in the following error: End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive.Running a backup of either the files or the full site downloads a zip without errors.