Here we collect some hints for Kolab Syncroton administrators.

1. Force re-synchronization of a device
---------------------------------------

From a user perspective there are two possibilities: delete and create again an account
in the ActiveSync client accounts configuration or delete the device entry
in Roundcube Settings > ActiveSync.

Administrators can do this more nicely using SQL:

- Force re-synchronization of all users/devices:

    DELETE FROM syncroton_synckey;

    Note: This will re-synchronize also folders structure.

- Force re-synchronization of all users/devices, but only of specified folder type:

    DELETE FROM syncroton_synckey
    WHERE type IN (SELECT id FROM syncroton_folder WHERE class = 'Calendar');

    Note: possible classes: Calendar, Tasks, Email, Notes, Contacts.

- Force re-synchronization of all devices of a specified user:

    DELETE FROM syncroton_synckey
    WHERE type IN (SELECT id FROM syncroton_folder
        WHERE device_id IN (SELECT id FROM syncroton_device
            WHERE owner_id IN (SELECT id FROM users WHERE user_id = 'test.test@example.org')
        )
    );

- Force re-synchronization of all contact folders of a specified user:

    DELETE FROM syncroton_synckey
    WHERE type IN (SELECT id FROM syncroton_folder
        WHERE class = 'Contacts' AND device_id IN (SELECT id FROM syncroton_device
            WHERE owner_id IN (SELECT user_id FROM users WHERE username = 'test.test@example.org')
        )
    );

    Note: possible classes: Calendar, Tasks, Email, Notes, Contacts.

Note: Above method will produce one warning entry for each folder in syncroton error log, but
other than that there should be no side effects and devices should re-synchronize data.
