Expected behaviour is to store the the exact selections made with each profile. This does not work for the second exclude list; "Exclude the data from the following tables", which keeps adding its defaults back.

Example: select all tables **except** the **users** table in the first list, and **no tables** (unselect all by clicking first on any one table, then CTRL+click on the same to make sure none are selected) in the second list:
1. Exclude the following tables alltogether
2. Exclude the data from the following tables

When I click on the backup button on the advanced settings page after having manually made sure no tables were selected in the second list, and only the users table were unselected in the first, then it actually works, I get the expected backup (roughly 6kb in my example with some 20+ user accounts). But it only works on that manual save after manually deselecting the tables. Once the page/profile is reloaded, the default selections for list 2 are back.

I did select to save and overwrite the profile, and have also done that manually (using the other button; "save without backing up"), but I am unable to make it remember my settings for the excluded tables in list number 2.

On the next backup with that profile, and/or also on the next load of that profile on the advanced page, the default selections for list 2 are back, and the backup size is now 25kb with many table definitions included.

This basically means that we cannot effectively deselect tables for scheduled profiles, which makes me mark this as "major".

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Leeteq’s picture

Title: Profiles does not store selections for excluding tables, but only the default pre-selected tables » Exclude the data from the following tables - does not work

(Better title.)

ronan’s picture

Status: Active » Postponed (maintainer needs more info)

I'm not able to reproduce this. When I check the 'Save these settings' checkbox, both lists are saved for me. Are you able to go into the profile in the settings tab and edit them from there?

ofry’s picture

I have such problem too. If I tried to "Save without copying" in admin/config/system/backup_migrate/export/advanced, I got this error:

Notice: Undefined index: profile_id in function backup_migrate_ui_manual_quick_backup_form_validate() (string 792 in file /home/u9974/domains/aprgr.ru/sites/all/modules/backup_migrate/backup_migrate.module).

Maybe this will help.

ofry’s picture

Status: Postponed (maintainer needs more info) » Active
ronan’s picture

Status: Active » Postponed (maintainer needs more info)

When you go to

admin/config/system/backup_migrate/settings/profile

are there any profiles listed there? What about in the pulldown at the top of the advanced settings page?

ofry’s picture

When I go to admin/config/system/backup_migrate/settings/profile, I have 2 profiles in list (default and my custom profile, imported from 7.x-2.x). I have selected my custom profile in pulldown.

ofry’s picture

Status: Postponed (maintainer needs more info) » Active
mitsuroseba’s picture

I have similar problem.
1) Have 1 custom profile and 1 default.
2) Goto admin/config/system/backup_migrate/export/advanced
3) turn off exclude options in "Exclude the following tables altogether" via checkbox
4) click "Save without backing up"

See screencast: http://screencast.com/t/3bVddPdrI.

Notice: Undefined index: profile_id in function backup_migrate_ui_manual_quick_backup_form_validate() (string 792 in file /home/u9974/domains/aprgr.ru/sites/all/modules/backup_migrate/backup_migrate.module).

For this notice i'm write little patch

ofry’s picture

Status: Active » Reviewed & tested by the community

Hello, mitsuroseba. Your patch solved my problem, thank you.

  • ronan committed 44de4a0 on 7.x-3.x authored by mitsuroseba
    Issue #2290707 Exclude the data from the following tables - does not...
ofry’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for commit. I set issue to fixed, if someone still have same problem, please, reopen issue.

Status: Fixed » Closed (fixed)

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

Kebz’s picture

The items that is being deselected based on the "screencast" from comment #8 (https://www.drupal.org/node/2290707#comment-8992483) ... is that mandatory to do along with the patch? Are those items needed?

tinkerbelle’s picture

Status: Closed (fixed) » Active

I'm still seeing the initial issue reported here: there is no way to unselect the default tables from the second, 'exclude data' dropdown -- even if you do so, the backup exports their structure only anyway, and when you reload the profile settings page they are magically reselected.

I tracked the magic as far as function _merge_defaults in crud.inc but I'm not sure how to patch things in a way that respects the desired default actions here and elsewhere (e.g. hook_backup_migrate_profiles_alter -- should other modules be able to add defaults to my desired settings?).

Nchase’s picture

I see the same problem here. all fields get macigally reselected. Comming from a d6 to d7 upgrade.

bsains’s picture

I've come across an instance where the serialized filter settings are truncated due to the max length of the text field type - 64kb.

Posting here as this could be a related issued.

https://www.drupal.org/node/2663066

DamienMcKenna’s picture

Still seeing this problem with the current -dev release.

DamienMcKenna’s picture

FYI I've confirmed this happens with a fresh install of the module, so the problem isn't because of legacy data.

DamienMcKenna’s picture

The problem is backup_migrate_item::__construct() combines the settings from saved filters value with the default, rather than replacing the default with the saved value.

DamienMcKenna’s picture

FYI the same problem with happen with other default fields if there was a value defined, it happens with the 'nodata_tables' value because there's a default for it.

DamienMcKenna’s picture

Thinking through it, I think the best approach to fix this would be to extend the classes to handle the config values being copied over.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
1.46 KB

I ended up having to override the profile constructor and perform a shallow merge of the params, rather than a recursive merge.

tinkerbelle’s picture

Thanks for looking into this! Patch in #22 is working for me and table selections are now respected -- so long as you use the dropdowns. My testing was confounded by a possibly-unrelated issue with the checkbox-selection option, where it seems like you can add selections, but unchecking does not remove them... (see also #2448973: Checkboxes for Exclusions don't work?).

Anthony Robertson’s picture

If anybody is really in a jam and needs a workaround - I figured out how to do this by exporting, modifying, and importing the settings.

1. Create your ideal settings profile. It will wind up excluding the watchdog table when you save it.
2. Export this settings profile.
3. Modify the exported profile by removing the line for 'watchdog' - in the 'nodata_tables' part
I re-ordered the following indexes so they remained sequential

...
'nodata_tables' =>
array (
'cache' => 'cache',
'cache_admin_menu' => 'cache_admin_menu',
'cache_block' => 'cache_block',
'cache_bootstrap' => 'cache_bootstrap',
...
21 => 'search_index',
22 => 'search_keywords_log',
23 => 'search_total',
// watchdog removed here
24 => 'accesslog',
25 => 'devel_queries',
26 => 'devel_times',
),
...

4. TEST importing this settings profile into a non-production environment.
5. Click 'Edit' to confirm that the data from the watchdog table is not being excluded - BUT DO NOT SAVE THE PROFILE
6. Test your download
7. If you're getting contents in the watchdog table of your backup, repeat 4-6 on any server where you want this settings profile

Remember not to modify or click 'Save' on the profile's settings page - or it will again exclude the watchdog table data no matter what you've selected / deselected.

I hope this is helpful!

Michelle’s picture

Status: Needs review » Reviewed & tested by the community

I tested the patch in #22 and it worked so that unselecting the default tables is respected.

JurriaanRoelofs’s picture

Patch 22 works great. Hope that this can be committed soon because accesslog is actually an important table for my site and this patch is needed to back it up.

DamienMcKenna’s picture

Alex Andrascu’s picture

:) A bit too late for that now (7.x-3.2 is out already) but let's look into that some point this week and turn it into 7.x-3.3 maybe along with anything else worth considering ?

DamienMcKenna’s picture

Darren Oh’s picture

FileSize
1.96 KB

Re-rolled patch.

  • Darren Oh authored be926c5 on 7.x-3.x
    Issue #2290707 by DamienMcKenna, mitsuroseba, Darren Oh: Exclude the...
Alex Andrascu’s picture

Status: Reviewed & tested by the community » Fixed

Committed and released. Thank you all for your hard work !

Status: Fixed » Closed (fixed)

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