SOGo | BTS

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004385SOGosogo-toolpublic2018-02-05 14:072018-04-27 12:37
ReporterASolana 
Assigned Tofrancis 
PriorityimmediateSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version3.2.10 
Target VersionFixed in Version4.0.1 
Summary0004385: Sogo-tool deletes sogo_acl table when it restores folders from a user backup
DescriptionI have a Sogo 3.2.10 server using a MYSQL sogo database

sogo-tool deletes sogo_acl table when it's restoring folders from a user backup file generated with sogo-tool.

Executed command: "sogo-tool -f ALL folder user"

I followed steps explained in page https://sogo.nu/support/faq/how-can-i-backuprestore-my-user-data.html [^]




I've activated "MySQL4DebugEnabled = YES;" in /etc/sogo/sogo.conf

sogo-tool -f ALL folder user > user.folder.restore.log 2>&1
Steps To Reproduce1. Activate Mysql debug in /etc/sogo/sogo.conf adding this line:
 "MySQL4DebugEnabled = YES;"

then restart sogo service:

service sogo restart


2. Create a user backup file with sogo-tool

sogo-tool -f ALL folder user

3. Create a Mysql sogo_acl table backup
mysqldump sogo sogo_acl > 1.sogo.sogo_acl.sql

4. Remove user
sogo-tool remove user


5. Restore user folders:
sogo-tool restore -f ALL folder user > user.folder.restore.log 2>&1

At this point all sogo_acl table contents are deleted.



user.folder.restore.log file contents shows how sogo-tool executes an "UPDATE" and a "DELETE FROM sogo_acl;" commands for every object folder in "user" backup file.

"DELETE FROM sogo_acl" command it has no sense, it deletes everything.


6. Create a Mysql sogo_acl table backup post restore:
mysqldump sogo sogo_acl > 2.sogo.sogo_acl.sql


You can see 2.sogo.sogo_acl.sql file is empty.

Additional InformationExecute this command:

cat sogo-tool.user.folder.restore.log | egrep "UPDATE|DELETE"

in order to see how "DELETE FROM sogo_acl;" is executed for each of 6 folders in the "usuari.elena2" backup file:


$ cat sogo-tool.user.folder.restore.log | egrep "UPDATE|DELETE"
2018-02-05 17:52:09.858 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: UPDATE sogo_folder_info SET c_foldername = 'Calendari personal' WHERE c_path = '/Users/usuari.elena2/Calendar/personal';
2018-02-05 17:52:09.861 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: DELETE FROM sogo_acl;
2018-02-05 17:52:10.030 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: UPDATE sogo_folder_info SET c_foldername = 'Llibreta d''adreces de usuari.elena2' WHERE c_path = '/Users/usuari.elena2/Contacts/CB76-5A761500-1-56127A00';
2018-02-05 17:52:10.034 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: DELETE FROM sogo_acl;
2018-02-05 17:52:10.056 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: UPDATE sogo_folder_info SET c_foldername = 'Agenda de usuari.elena2' WHERE c_path = '/Users/usuari.elena2/Calendar/CC1E-5A761580-1-452BAD80';
2018-02-05 17:52:10.059 sogo-tool[37559] <MySQL4Channel[0x0x27ff6a0] connection=0x0x2a6abe0> SQL: DELETE FROM sogo_acl;
2018-02-05 17:52:10.179 sogo-tool[37559] <MySQL4Channel[0x0x27ff6a0] connection=0x0x2a6abe0> SQL: UPDATE sogo_folder_info SET c_foldername = 'Copia ASF' WHERE c_path = '/Users/usuari.elena2/Contacts/CB99-5A761500-1-5B8A7700';
2018-02-05 17:52:10.183 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: DELETE FROM sogo_acl;
2018-02-05 17:52:16.634 sogo-tool[37559] <MySQL4Channel[0x0x27ff6a0] connection=0x0x2a6abe0> SQL: UPDATE sogo_folder_info SET c_foldername = 'Personal Address Book' WHERE c_path = '/Users/usuari.elena2/Contacts/personal';
2018-02-05 17:52:16.639 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: DELETE FROM sogo_acl;
2018-02-05 17:52:16.650 sogo-tool[37559] <MySQL4Channel[0x0x27ff6a0] connection=0x0x2a6abe0> SQL: UPDATE sogo_folder_info SET c_foldername = '2on. calendari usuari.elena2' WHERE c_path = '/Users/usuari.elena2/Calendar/CC3F-5A761580-1-6EE7C600';
2018-02-05 17:52:16.654 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: DELETE FROM sogo_acl;
TagsNo tags attached.
Attached Fileslog file icon sogo-tool.user.folder.restore.log [^] (1,886,202 bytes) 2018-02-05 14:07

- Relationships Relation Graph ] Dependency Graph ]
duplicate of 0004256resolvedfrancis sogo-tool (SOGo-3.2.10) cannot fully restore backup generated by SOGo-2.3.22 
has duplicate 0004390closedfrancis Sogo-tool deletes sogo_acl table when it restores folders from a user backup 

-  Notes
(0012562)
ASolana (reporter)
2018-02-05 14:11

The Reproducibility is ALWAYS (not sometimes).
(0012582)
ASolana (reporter)
2018-02-07 11:30

I cannot change Reproducibility contents to "Always", so I've opened other bug

https://sogo.nu/bugs/view.php?id=4390 [^] with maximum priority and "Reproducibility=Always"

- Related Changesets
sogo: master f3189204
Timestamp: 2018-04-27 12:34:55
Author: francis
Details ] Diff ]
(sogo-tool) Fix ACLs restore in single store mode

Fixes 0004256
Fixes 0004385
Fixes 0004390
mod - NEWS Diff ] File ]
mod - SOPE/GDLContentStore/GCSFolder.m Diff ] File ]
mod - Tools/SOGoToolRestore.m Diff ] File ]

- Issue History
Date Modified Username Field Change
2018-02-05 14:07 ASolana New Issue
2018-02-05 14:07 ASolana File Added: sogo-tool.user.folder.restore.log
2018-02-05 14:11 ASolana Note Added: 0012562
2018-02-07 11:25 francis Relationship added has duplicate 0004390
2018-02-07 11:30 ASolana Note Added: 0012582
2018-02-07 11:45 francis Severity major => minor
2018-02-07 11:45 francis Reproducibility sometimes => always
2018-02-07 11:45 francis Relationship added duplicate of 0004256
2018-04-27 12:36 francis Changeset attached => sogo master f3189204
2018-04-27 12:36 francis Assigned To => francis
2018-04-27 12:36 francis Resolution open => fixed
2018-04-27 12:37 francis Status new => resolved
2018-04-27 12:37 francis Fixed in Version => 4.0.1


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker