-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drush archive restore “Unable to determine mime type” #1292
Comments
The issue is that when drupal.sql is checked through if (class_exists('finfo')) {
$finfo = new finfo(FILEINFO_MIME_TYPE);
$content_type = $finfo->file($filename);
if ($content_type == 'application/octet-stream') {
drush_log(dt('Mime type for !file is application/octet-stream.', array('!file' => $filename)), 'debug');
$content_type = FALSE;
}
} Will set Further down, there are other attempts to determine the mime type, but those all fail for .sql since that special case isn't present. Since technically speaking, a .sql file has no mime-type meaning that octet-stream is the right one, what we need is to add an entry in the array (similarly to what .tar files have) for the .sql file. This $extension_mimetype = array(
'.tar' => 'application/x-tar',
); Should be $extension_mimetype = array(
'.tar' => 'application/x-tar',
'.sql' => 'application/octet-stream',
); I'll post a pull request in a few minutes. |
Fix #1292. Add mime type for .sql files
I realize this problem was "fixed" almost 3 years ago, but I just got the same problem using Drush v8.1.9:
I restored the DB manually and moved site worked fine. I didn't expect this to be a problem, since it was reported as "fixed". |
I created a backup with drush archive-dump --description, but when I try to restore with drush arr ./drush-backups/archive-dump/.tar.gz --db-url=mysql:// --destination=/home/ I get an error "Unable to determine mime type for ". After the error, the command continues and appears to correctly restore the doc dir, but the db remains empty.
Also asked here.
The text was updated successfully, but these errors were encountered: