When using an alias file dumping from a remote database to a local one, if %dump path is specified, drush fails to overwrite an existing dump file and imports the old file, from the first good dump. All subsequent imports will import that first dump.

Happens across sites.

If you change the name of the dump file in the alias file, drush imports the correct dump. That means it's not a permissions issue.

I found a temporary workaround by hacking the module.

Remove the if statement from sync.sql.inc on line 185 so that this

      if ($source_settings['dump-is-temp']) {
        $source_rsync_options['remove-source-files'] = TRUE;
      }

becomes this:

      $source_rsync_options['remove-source-files'] = TRUE;

Don't like that but it does the job. I can't find a cli switch for this option. Hoping somebody smarter than me will fix it!

Comments

greg.1.anderson’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Perhaps the option you are looking for is --no-cache. It would not be a good idea to make the change suggested above; deleting non-temp files subverts the cache option and the fast rsync behavior that overwriting an existing dump file provides.

moshe weitzman’s picture

Status: Postponed (maintainer needs more info) » Fixed

Please reopen as needed.

glass.dimly’s picture

Status: Fixed » Active

The comment in #1 addresses my workaround, but not the issue itself.

Re-opening.

greg.1.anderson’s picture

Status: Active » Postponed (maintainer needs more info)

Have you tried the --no-cache option?

greg.1.anderson’s picture

Version: » 8.x-6.x-dev
Status: Postponed (maintainer needs more info) » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If you still need help, please ask your question again on Drupal Answers and then post a link here to the new question. Please also change the status of this issue to closed (duplicate).

Use our Github project for contributing code, or reporting bugs, or requesting features.