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".
Comment | File | Size | Author |
---|---|---|---|
#30 | exclude_data_setting_reverting-2290707-30.patch | 1.96 KB | Darren Oh |
Comments
Comment #1
Leeteq CreditAttribution: Leeteq commented(Better title.)
Comment #2
ronan CreditAttribution: ronan commentedI'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?
Comment #3
ofry CreditAttribution: ofry commentedI 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.
Comment #4
ofry CreditAttribution: ofry commentedComment #5
ronan CreditAttribution: ronan commentedWhen 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?
Comment #6
ofry CreditAttribution: ofry commentedWhen 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.
Comment #7
ofry CreditAttribution: ofry commentedComment #8
mitsuroseba CreditAttribution: mitsuroseba commentedI 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
Comment #9
ofry CreditAttribution: ofry commentedHello, mitsuroseba. Your patch solved my problem, thank you.
Comment #11
ofry CreditAttribution: ofry commentedThanks for commit. I set issue to fixed, if someone still have same problem, please, reopen issue.
Comment #13
Kebz CreditAttribution: Kebz commentedThe 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?
Comment #14
tinkerbelle CreditAttribution: tinkerbelle as a volunteer commentedI'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?).
Comment #15
Nchase CreditAttribution: Nchase as a volunteer commentedI see the same problem here. all fields get macigally reselected. Comming from a d6 to d7 upgrade.
Comment #16
bsains CreditAttribution: bsains commentedI'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
Comment #17
DamienMcKennaStill seeing this problem with the current -dev release.
Comment #18
DamienMcKennaFYI I've confirmed this happens with a fresh install of the module, so the problem isn't because of legacy data.
Comment #19
DamienMcKennaThe 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.
Comment #20
DamienMcKennaFYI 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.
Comment #21
DamienMcKennaThinking through it, I think the best approach to fix this would be to extend the classes to handle the config values being copied over.
Comment #22
DamienMcKennaI ended up having to override the profile constructor and perform a shallow merge of the params, rather than a recursive merge.
Comment #23
tinkerbelle CreditAttribution: tinkerbelle as a volunteer commentedThanks 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?).
Comment #24
Anthony Robertson CreditAttribution: Anthony Robertson commentedIf 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!
Comment #25
MichelleI tested the patch in #22 and it worked so that unselecting the default tables is respected.
Comment #26
JurriaanRoelofs CreditAttribution: JurriaanRoelofs commentedPatch 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.
Comment #27
DamienMcKennaComment #28
Alex Andrascu CreditAttribution: Alex Andrascu at Intellix commented:) 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 ?
Comment #29
DamienMcKennaComment #30
Darren OhRe-rolled patch.
Comment #32
Alex Andrascu CreditAttribution: Alex Andrascu at Intellix commentedCommitted and released. Thank you all for your hard work !