We do copy the respective database:
I will try to reproduce this myself now.
Hmm, yes, but it seems better to just move copy process itself further down, immediately before the swapping. Hereby, users will be able to use the database all the time and no locking happens. If they would try to add something in the exact milliseconds the swapping happens, we already show an error as the database will indeed be locked during this short time interval.
edit Reproduced. Group assignments are correctly copied and kept.
However, one of the triggers fires and adds the default group for all added clients on top of their already configured groups. This is clearly a bug and needs to be addresses. The only way to do this is to delete the triggers before copying the stuff and re-add them later again.