static public void copyFrom(GeoServerUserGroupService service, GeoServerUserGroupStore store) throws IOException,PasswordPolicyException {
GeoServerPasswordEncoder encoder = store.getSecurityManager().loadPasswordEncoder(store.getPasswordEncoderName());
encoder.initializeFor(store);
GeoServerMultiplexingPasswordEncoder mEncoder = new
GeoServerMultiplexingPasswordEncoder(store.getSecurityManager(),service);
store.clear();
Map<String,GeoServerUser> newUserDict = new HashMap<String,GeoServerUser>();
Map<String,GeoServerUserGroup> newGroupDict = new HashMap<String,GeoServerUserGroup>();
for (GeoServerUser user : service.getUsers()) {
String rawPassword = null;
String encPassword = null;
try {
rawPassword = mEncoder.decode(user.getPassword());
encPassword= encoder.encodePassword(rawPassword, null);
} catch (UnsupportedOperationException ex) {
LOGGER.warning("Cannot recode user: "+user.getUsername()+" password: "+user.getPassword());
encPassword=user.getPassword();
}