public final class AtlassianUserDataMigrator extends Object
Note: we have to do this the one-by-one way rather than doing it in the database because otherwise Crowd will not get the chance to do things like case-normalisation in its own way.
Could be also used for on-demand migration after an upgrade, but you should be careful that you don't clobber data. The upgrade task checks for existing users before doing any migration.
This upgrade task is only retained due to its usage in com.atlassian.studio.confluence.startup.ConfluenceInitialData.
Constructor and Description |
---|
AtlassianUserDataMigrator(net.sf.hibernate.SessionFactory sessionFactory,
com.atlassian.crowd.embedded.spi.UserDao userDao,
com.atlassian.crowd.embedded.spi.GroupDao groupDao,
com.atlassian.crowd.embedded.spi.MembershipDao membershipDao,
com.atlassian.crowd.embedded.api.CrowdService crowdService) |
Modifier and Type | Method and Description |
---|---|
void |
migrateExternalMemberships() |
void |
migrateGroupMemberships(com.atlassian.crowd.embedded.api.Directory internalDirectory) |
void |
migrateGroups(com.atlassian.crowd.embedded.api.Directory internalDirectory) |
void |
migrateUserProperties(com.atlassian.crowd.embedded.api.Directory internalDirectory)
Migrates user properties from post-2.7 versions of Confluence by changing
entity_name s in the os_propertyentry table to CWD_<lowercase_username>. |
void |
migrateUsers(com.atlassian.crowd.embedded.api.Directory internalDirectory) |
public AtlassianUserDataMigrator(net.sf.hibernate.SessionFactory sessionFactory, com.atlassian.crowd.embedded.spi.UserDao userDao, com.atlassian.crowd.embedded.spi.GroupDao groupDao, com.atlassian.crowd.embedded.spi.MembershipDao membershipDao, com.atlassian.crowd.embedded.api.CrowdService crowdService)
public void migrateUserProperties(com.atlassian.crowd.embedded.api.Directory internalDirectory)
entity_name
s in the os_propertyentry
table to CWD_<lowercase_username>.
If users with the same (case-insensitive) entity_name
exist from different repositories,
we should treat them all as the same user. In this case, the properties of the user with
the most recent activity against the username will be preserved, all others will be removed.
internalDirectory
- The directory to migrate topublic void migrateGroupMemberships(com.atlassian.crowd.embedded.api.Directory internalDirectory)
public void migrateUsers(com.atlassian.crowd.embedded.api.Directory internalDirectory)
public void migrateGroups(com.atlassian.crowd.embedded.api.Directory internalDirectory)
public void migrateExternalMemberships()
Copyright © 2003–2016 Atlassian. All rights reserved.