View Issue Details

IDProjectCategoryView StatusLast Update
0004045SOGosogo-toolpublic2017-03-09 10:03
Reporterjmalvarez Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platform[Server] LinuxOSRHEL/CentOSOS Version7
Product Version3.2.7 
Summary0004045: sogo-tool backup and restore fails
Description

836/5000
I am doing migration testing from a production environment from version 2.3.19 to version 3.2.7 the two with backend postgresql 9.5. Version 3.2.7 is in a clean 7 centos.
I backup using sogo-tool backup and copy the files to the new environment. There I do a sogo-tool restore of preferences and data and everything seems correct, but when I access the calendars via web, the subscribed calendars and subscribed address books do not appear.

I have made several migrations with v2 and it has always gone well. I know the configuration of "sogo.conf" in v3 has more values for the databases and still nothing.

User backup files have the data of the subscriptions correctly.

No per-user tables are made. There are only 9 tables in the database after restore.

I am doing something wrong?
Is there any way to backup and restore in debug mode?

Steps To Reproduce

V2

/usr/sbin/sogo-tool backup /tmp/sogobck ALL

copy folder /tmp/sogobck to V3

for i in $( ls /tmp/sogobck/); do
echo "Processing $i user..."
/usr/sbin/sogo-tool restore -F ALL /tmp/sogobck/ $i
/usr/sbin/sogo-tool restore -p /tmp/sogobck/ $i
done

TagsNo tags attached.

Activities

Christian Mack

Christian Mack

2017-02-22 08:50

developer   ~0011345

Last edited: 2017-02-22 08:51

This is not an error in sogo-tool or your configuration.
This is a common utilization fault and occurs in V2 and V3.
You have to restore the settings twice, because not all subscribed folders are there already.
So in short for each user do restore all the folders, then a "restore -p".
After all users are there, do for each user again a "restore -p".
With that all settings and subscriptions are there.

Perhaps this should be documented.

jmalvarez

jmalvarez

2017-02-23 10:34

reporter   ~0011364

It seems that everything it is OK. What happens is that only people who are "SOGoSuperUsernames" can see the subscriptions. I've tried adding a normal user to the SOGoSuperUsernames list and it shows all the calendars and address books they have subscribed.

Also, once done the restore in version 3. If I subscribe a calendar to a user, I make a backup of the user, I delete it and I restore again and it still does not appear.

If you need the backup files or anything, I can give them.

jmalvarez

jmalvarez

2017-02-23 13:03

reporter   ~0011365

I've done a clean install of the latest version nightly.
Both userA and userB are normal users.
I have logged in as user, I have created an event. Then I shared my calendar with userB.
I have logged in as userB and I see and modify the userA calendar perfectly.
I made a backup of the two users.
sogo-tool backup /DIR userA
sogo-tool backup /DIR userB

I have stopped sogod memcached and httpd

I deleted the database and created it again.

I have started sogod and memcached (the database tables have been created correctly)

I have restored user copies.

sogo-tool restore -p /DIR userA
sogo-tool restore -F ALL /DIR userA
sogo-tool restore -p /DIR userB
sogo-tool restore -F ALL /DIR userB
sogo-tool restore -p /DIR userA
sogo-tool restore -p /DIR userB

The logs do not give any database errors.

Restart sogod memcached and httpd services

I have logged in as userB and I do not see the subscribed userA calendar. I have tried to subscribe and it tells me that it is not possible.

I have logged in as a userA and the calendar appears as it is not shared by anyone.

Christian Mack

Christian Mack

2017-02-23 13:22

developer   ~0011366

sogo-tool restore -p /DIR userA
sogo-tool restore -F ALL /DIR userA

That is the wrong way round.

Try it with first restoring the folders, then the settings:
sogo-tool restore -F ALL /DIR userA
sogo-tool restore -p /DIR userA

jmalvarez

jmalvarez

2017-02-24 07:26

reporter  

eflores (2,187 bytes)   
{
    preferences = (
	{
	    AuxiliaryMailAccounts = (
	    );
	    LocaleCode = es;
	    SOGoAlternateAvatar = none;
	    SOGoAppointmentSendEMailNotifications = <*I1>;
	    SOGoCalendarDefaultReminder = NONE;
	    SOGoCalendarEventsDefaultClassification = PUBLIC;
	    SOGoCalendarTasksDefaultClassification = PUBLIC;
	    SOGoDayEndTime = "18:00";
	    SOGoDayStartTime = "08:00";
	    SOGoDefaultCalendar = selected;
	    SOGoFirstDayOfWeek = <*I1>;
	    SOGoFirstWeekOfYear = January1;
	    SOGoGravatarEnabled = <*I0>;
	    SOGoLanguage = SpanishSpain;
	    SOGoLoginModule = Calendar;
	    SOGoLongDateFormat = "%A, %B %d, %Y";
	    SOGoMailAutoSave = <*I0>;
	    SOGoMailComposeFontSize = <*I0>;
	    SOGoMailComposeMessageType = html;
	    SOGoMailDisplayRemoteInlineImages = never;
	    SOGoMailMessageForwarding = inline;
	    SOGoMailReceiptAllow = 1;
	    SOGoMailReceiptAnyAction = ignore;
	    SOGoMailReceiptNonRecipientAction = ignore;
	    SOGoMailReceiptOutsideDomainAction = ignore;
	    SOGoMailReplyPlacement = below;
	    SOGoMailSignaturePlacement = below;
	    SOGoRefreshViewCheck = manually;
	    SOGoRememberLastModule = <*I0>;
	    SOGoSelectedAddressBook = personal;
	    SOGoShortDateFormat = "%d-%b-%y";
	    SOGoTimeFormat = "%H:%M";
	    SOGoTimeZone = "Europe/Madrid";
	},
	{
	    Calendar = {
		EventsFilterState = "view_next7";
		EventsSortingState = (
		    start,
		    1
		);
		FolderDisplayNames = {
		    "mmarquez:Calendar/personal" = "Calendario personal (Miguel Angel Marquez Martin <mmarquez@diphuelva.org>)";
		};
		FolderShowAlarms = {
		    "mmarquez:Calendar/personal" = <*I0>;
		};
		FoldersOrder = (
		    "mmarquez_personal",
		    personal
		);
		PreventInvitationsWhitelist = {
		};
		SubscribedFolders = (
		    "mmarquez:Calendar/personal"
		);
		View = weekview;
	    };
	    Contact = {
	    };
	    Mail = {
	    };
	}
    );
    tables = {
	"/Users/eflores/Calendar/personal" = {
	    acl = {
	    };
	    displayname = "Calendario personal";
	    records = (
	    );
	};
	"/Users/eflores/Contacts/personal" = {
	    acl = {
	    };
	    displayname = "Libreta personal de direcciones";
	    records = (
	    );
	};
    };
}
eflores (2,187 bytes)   
jmalvarez

jmalvarez

2017-02-24 07:26

reporter  

mmarquez (2,788 bytes)   
{
    preferences = (
	{
	    AuxiliaryMailAccounts = (
	    );
	    LocaleCode = es;
	    SOGoAlternateAvatar = none;
	    SOGoAppointmentSendEMailNotifications = <*I1>;
	    SOGoCalendarDefaultReminder = NONE;
	    SOGoCalendarEventsDefaultClassification = PUBLIC;
	    SOGoCalendarTasksDefaultClassification = PUBLIC;
	    SOGoDayEndTime = "18:00";
	    SOGoDayStartTime = "08:00";
	    SOGoDefaultCalendar = selected;
	    SOGoFirstDayOfWeek = <*I1>;
	    SOGoFirstWeekOfYear = January1;
	    SOGoGravatarEnabled = <*I0>;
	    SOGoLanguage = SpanishSpain;
	    SOGoLoginModule = Calendar;
	    SOGoLongDateFormat = "%A, %B %d, %Y";
	    SOGoMailAutoSave = <*I0>;
	    SOGoMailComposeFontSize = <*I0>;
	    SOGoMailComposeMessageType = html;
	    SOGoMailDisplayRemoteInlineImages = never;
	    SOGoMailMessageForwarding = inline;
	    SOGoMailReceiptAllow = 1;
	    SOGoMailReceiptAnyAction = ignore;
	    SOGoMailReceiptNonRecipientAction = ignore;
	    SOGoMailReceiptOutsideDomainAction = ignore;
	    SOGoMailReplyPlacement = below;
	    SOGoMailSignaturePlacement = below;
	    SOGoRefreshViewCheck = manually;
	    SOGoRememberLastModule = <*I0>;
	    SOGoSelectedAddressBook = personal;
	    SOGoShortDateFormat = "%d-%b-%y";
	    SOGoTimeFormat = "%H:%M";
	    SOGoTimeZone = "Europe/Madrid";
	},
	{
	    Calendar = {
		EventsFilterState = "view_next7";
		EventsSortingState = (
		    start,
		    1
		);
		FoldersOrder = (
		    personal
		);
		PreventInvitationsWhitelist = {
		};
		View = weekview;
	    };
	    Contact = {
	    };
	    Mail = {
	    };
	}
    );
    tables = {
	"/Users/mmarquez/Calendar/personal" = {
	    acl = {
		eflores = (
		    ObjectEraser,
		    ObjectCreator,
		    PrivateModifier,
		    ConfidentialModifier,
		    PublicModifier
		);
	    };
	    displayname = "Calendario personal";
	    records = (
		{
		    "c_content" = "BEGIN:VCALENDAR
PRODID:-//Inverse inc./SOGo 3.2.7//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Europe/Madrid
X-LIC-LOCATION:Europe/Madrid
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:66E6-58AFDE00-1-32F86B80
SUMMARY:test1
CLASS:PUBLIC
TRANSP:OPAQUE
DTSTART;TZID=Europe/Madrid:20170224T090000
DTEND;TZID=Europe/Madrid:20170224T110000
CREATED:20170224T071748Z
DTSTAMP:20170224T071748Z
LAST-MODIFIED:20170224T071748Z
END:VEVENT
END:VCALENDAR";
		    "c_name" = "66E6-58AFDE00-1-32F86B80.ics";
		}
	    );
	};
	"/Users/mmarquez/Contacts/personal" = {
	    acl = {
	    };
	    displayname = "Libreta personal de direcciones";
	    records = (
	    );
	};
    };
}
mmarquez (2,788 bytes)   
jmalvarez

jmalvarez

2017-02-24 08:22

reporter   ~0011376

It does not work either. I have uploaded the backup files of the two users.

jmalvarez

jmalvarez

2017-03-07 09:09

reporter   ~0011446

I'm debugging SQL in sogo-tool and appears:

INSERT INTO sogo_alarms_acl (c_object, c_uid, c_role) VALUES ('/userA/Calendar/personal', 'userB', 'ObjectEraser')

and field c_folder_id is missing. It's the problem because when I add suscription in WebUI, the log says:

INSERT INTO sogo_alarms_acl (c_object, c_uid, c_role, c_folder_id) VALUES ('/userA/Calendar/personal', 'userB', 'ObjectEraser', 16)

and all works well.

Issue History

Date Modified Username Field Change
2017-02-21 09:47 jmalvarez New Issue
2017-02-22 08:50 Christian Mack Note Added: 0011345
2017-02-22 08:51 Christian Mack Note Edited: 0011345
2017-02-23 10:34 jmalvarez Note Added: 0011364
2017-02-23 13:03 jmalvarez Note Added: 0011365
2017-02-23 13:22 Christian Mack Note Added: 0011366
2017-02-23 13:25 ludovic Priority high => normal
2017-02-23 13:25 ludovic Severity crash => minor
2017-02-24 07:26 jmalvarez File Added: eflores
2017-02-24 07:26 jmalvarez File Added: mmarquez
2017-02-24 08:22 jmalvarez Note Added: 0011376
2017-03-07 09:09 jmalvarez Note Added: 0011446