When I attempted to create multiple schedules (daily, weekly, monthly) with multiple destinations (/daily, /weekly, /monthly) using the same profile, all the backups were saved into the /daily folder.

After doing a little digging I found the suspect code:

FILE: includes/profiles.inc

/**
   * Get the destination of the profile.
   */
  function get_destination() {
    backup_migrate_include('destinations');
    if (empty($this->destination) && !empty($this->destination_id)) {
      $this->destination = backup_migrate_get_destination($this->destination_id);
    }
    return empty($this->destination) ? NULL : $this->destination;
  }

This code ignores the 'destination' re-assignment' if '$this->destination' is NOT empty, which is what happens when this function gets called on the subsequent destinations.

The following code fixes this:

/**
   * Get the destination of the profile.
   */
  function get_destination() {
    backup_migrate_include('destinations');
    if ((empty($this->destination) && !empty($this->destination_id)) || 
        (!empty($this->destination) && !empty($this->destination_id) && 
        ($this->destination->destination_id != $this->destination_id))) {
      $this->destination = backup_migrate_get_destination($this->destination_id);
    }
    return empty($this->destination) ? NULL : $this->destination;
  }

I have included a patch as well.

CommentFileSizeAuthor
profiles-inc.patch724 bytesvarr

Comments

dgorton’s picture

Status: Active » Needs review
ronan’s picture

Status: Needs review » Fixed

I think this has been fixed by a separate patch. Please reopen if the latest dev still has this issue. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

danielphenry’s picture

Status: Closed (fixed) » Needs work

I'm encountering this issue on version 7.x-3.1 I haven't confirmed it's caused by using the same profile but I am using the same profile with 3 destination and only the first destination I created is getting 3 copies of every backup. Is their a more recent version of this issue?

couturier’s picture

Version: 6.x-2.2 » 7.x-3.x-dev

I'm unaware of another similar issue for 7.x, so I am moving this issue to the 7.x-3.x-dev branch based on Comment #4. Drupal core and Backup and Migrate 6.x is no longer supported.

damienmckenna’s picture

Status: Needs work » Closed (cannot reproduce)

Unable to reproduce this.