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.
Constructor and Description |
---|
AtlassianUserDataMigrator(org.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,
com.atlassian.crowd.manager.directory.DirectoryManager directoryManager) |
Modifier and Type | Method and Description |
---|---|
void |
migrateExternalMemberships(Connection connection,
@NotNull com.atlassian.crowd.embedded.api.Directory externalDirectory) |
void |
migrateGroupMemberships(com.atlassian.crowd.embedded.api.Directory internalDirectory,
Connection connection) |
void |
migrateGroups(com.atlassian.crowd.embedded.api.Directory internalDirectory,
Connection connection) |
void |
migrateUserProperties(com.atlassian.crowd.embedded.api.Directory internalDirectory,
Connection connection)
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,
Connection connection) |
public AtlassianUserDataMigrator(org.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, com.atlassian.crowd.manager.directory.DirectoryManager directoryManager)
public void migrateUserProperties(com.atlassian.crowd.embedded.api.Directory internalDirectory, Connection connection)
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, Connection connection)
public void migrateUsers(com.atlassian.crowd.embedded.api.Directory internalDirectory, Connection connection)
public void migrateGroups(com.atlassian.crowd.embedded.api.Directory internalDirectory, Connection connection)
public void migrateExternalMemberships(Connection connection, @NotNull @NotNull com.atlassian.crowd.embedded.api.Directory externalDirectory)
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.
View cookie preferences