How to migrate existing users over to Atlassian-User

This document has been deprecated (as of 16th of February 2006). Please see this document instead.

All versions of Confluence up to and including 2.0.x made use of a component called OSUser to store and manage users. We've written our own component to do this and its called Atlassian-User.

The two main reasons for migrating over to Atlassian-User are:

  1. If you want to take advantage of the new Atlassian-User-LDAP-Integration
  2. Atlassian-User is more performant than OSUser

Please follow these steps to migrate your users:

  1. Make a backup of your:
    • database
    • Confluence home directory
    • confluence/WEB-INF/classes/atlassianUserContext.xml (only if you have made changes)
  2. Download hibernate_osuser_atlassianUserContext.xml and rename to atlassianUserContext.xml and copy to your confluence/WEB-INF/classes directory (you can overwrite the one that's there)
  3. Now uncomment the osuserMigrationBean in confluence/WEB-INF/classes/upgradeSubsystemContext.xml
    <!-- To be used. optionally, to transfer ouser data to another repository. See osuser2atluser.jsp -->
        <bean id="osuserMigrationBean" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
            <property name="transactionManager">
                <ref bean="transactionManager"/>
            </property>
            <property name="target">
                <ref local="osuserMigrationBeanTarget"/>
            </property>
            <property name="transactionAttributes">
                <props>
                    <prop key="*">PROPAGATION_REQUIRED</prop>
                </props>
            </property>
            <property name="proxyInterfaces">
                <value>com.atlassian.user.util.migration.EntityMigrator</value>
            </property>
        </bean>
    
        <bean id="osuserMigrationBeanTarget" class="com.atlassian.user.util.migration.OSUEntityMigrator">
            <constructor-arg index="0">
                <ref bean="hibernateUserManager" />
            </constructor-arg>
            <constructor-arg index="1">
                <ref bean="hibernateGroupManager" />
            </constructor-arg>
            <constructor-arg index="2">
                <ref bean="hibernatePropertySetFactory" />
            </constructor-arg>
            <constructor-arg index="3">
                <ref bean="profileProvider" />
            </constructor-arg>
            <constructor-arg index="4">
                <ref bean="accessProvider" />
            </constructor-arg>
        </bean>
  4. Restart Confluence and login as an Administrator and point a browser to *http://your.server.com/admin/osuser2atluser.jsp*
  5. Click the link Begin migration
  6. You will know the migration has been successful if you see this reported:
    Migrating users ... Users migrated successfully! Migrating propertyset data ... Propertyset data migrated successfully! Migrating groups ... Groups migrated successfully!


    If you encounter errors, please create a support ticket at http://support.atlassian.com and attach your application server logs.

  7. Stop Confluence and comment back in the osuMigrationBean in confluence/WEB-INF/classes/upgradeSubsystemContext.xml. That is:
    <!-- To be used. optionally, to transfer ouser data to another repository. See osuser2atluser.jsp -->
        <!--<bean id="osuserMigrationBean" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
            <property name="transactionManager">
                <ref bean="transactionManager"/>
            </property>
            <property name="target">
                <ref local="osuserMigrationBeanTarget"/>
            </property>
            <property name="transactionAttributes">
                <props>
                    <prop key="*">PROPAGATION_REQUIRED</prop>
                </props>
            </property>
            <property name="proxyInterfaces">
                <value>com.atlassian.user.util.migration.EntityMigrator</value>
            </property>
        </bean>
     
        <bean id="osuserMigrationBeanTarget" class="com.atlassian.user.util.migration.OSUEntityMigrator">
            <constructor-arg index="0">
                <ref bean="hibernateUserManager" />
            </constructor-arg>
            <constructor-arg index="1">
                <ref bean="hibernateGroupManager" />
            </constructor-arg>
            <constructor-arg index="2">
                <ref bean="hibernatePropertySetFactory" />
            </constructor-arg>
            <constructor-arg index="3">
                <ref bean="profileProvider" />
            </constructor-arg>
            <constructor-arg index="4">
                <ref bean="accessProvider" />
            </constructor-arg>
        </bean>-->
  8. Start up Confluence and you should be able to login as per normal
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Dec 20, 2005

    Damon Rand says:

    There is an issue with the attached hibernate_osuser_atlassianUserContext.xml fi...

    There is an issue with the attached hibernate_osuser_atlassianUserContext.xml file. It has two hibernateEntityQueryParser beans defined.. You need to delete one for it too work.

    1. Dec 20, 2005

      Daniel Ostermeier says:

      Hi Damon, Thank you for bringing this to our attention. This will be fixed shor...

      Hi Damon,

      Thank you for bringing this to our attention. This will be fixed shortly.

      Regards,
      -Daniel

  2. Dec 20, 2005

    Damon Rand says:

    I got as far as step 3.2. I am running TC 5.5.12 on JDK 5. Tomcat tells me.. o...

    I got as far as step 3.2. I am running TC 5.5.12 on JDK 5. Tomcat tells me..

    org.apache.jasper.JasperException: Unable to compile class for JSP
    
    Generated servlet error:
    Only a type can be imported. com.atlassian.user.util.migration.OSEntityMigrator resolves to a package
    
    
    	at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
    	at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
    1. Dec 20, 2005

      Daniel Ostermeier says:

      Hi Damon, There is a mistake in the imports at the top of the jsp. java.util....

      Hi Damon,

      There is a mistake in the imports at the top of the jsp.

      java.util.*,
      com.atlassian.user.util.migration.OSEntityMigrator,
      com.atlassian.user.util.migration.OSUEntityMigrator,
      com.atlassian.user.GroupManager,

      should be

      java.util.*,
      com.atlassian.user.util.migration.OSUEntityMigrator,
      com.atlassian.user.GroupManager,

      Regards,
      -Daniel

      1. Dec 21, 2005

        Damon Rand says:

        Thanks, this works now!

        Thanks, this works now!

  3. Dec 20, 2005

    Damon Rand says:

    By the way, what if I want to migrate from osuser accounts to ldap accounts inst...

    By the way, what if I want to migrate from osuser accounts to ldap accounts instead? My osuser usernames match my ldap account names because I have been running osuser in ldap configuration until now.

    1. Dec 20, 2005

      Daniel Ostermeier says:

      Hi Damon, So long as the usernames match, this will be okay. Confluence refers ...

      Hi Damon,

      So long as the usernames match, this will be okay. Confluence refers to users by there username, so as long the username exists in one of the repositories, all is okay.

      Regards,
      -Daniel

      1. Dec 21, 2005

        Damon Rand says:

        Yes, it does seem to work. The issue though is that users with hibernate account...

        Yes, it does seem to work. The issue though is that users with hibernate accounts will not have synchronised email accounts. What I really need is a second process that migrates users from atluser_hibernate to atluser_ldap. I imagine the second process would be fairly easily, the JSP would just need to try and copy the user from "hibernateUserManager" to the "cachingLdapUserManager" and if successful delete them from hibernate.

        <bean id="delegatingUserManagerTarget" class="com.atlassian.user.impl.delegation.DelegatingUserManager" singleton="true" >
            <constructor-arg index="0">
                <ref bean="hibernateUserManager" />
            </constructor-arg>
            <constructor-arg index="1">
                <ref bean="cachingLdapUserManager" />
            </constructor-arg>
        </bean>
         </constructor-arg>
        1. Dec 21, 2005

          Damon Rand says:

          Actually I notice there is already an issue for this. CONF-4858

          Actually I notice there is already an issue for this. CONF-4858