Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-58047

Performing a second Space import from Cloud, after not choosing email matching, fails.

XMLWordPrintable

      Issue Summary

      Background

      Confluence 6.15.1 shipped with a new functionality which allows to enable additional matching logic upon importing Spaces from Cloud. In future, Cloud will stop to export usernames and replace them with email addresses (or unique number identifiers) in Space export. These emails can be matched with users' emails set in Confluence Server. Learn more in this KB article: https://confluence.atlassian.com/display/DOC/Import+a+space+from+Confluence+Cloud

      The email-matching process is enabled on the admin page Backup & Restore by checking the "Attribute content created in Confluence Cloud to matching users in this site (Cloud spaces only)" checkbox. If a User performs such Cloud import and forgets to set this checkbox, when they reimport again, having it set this time, such import would fail.

      Steps to Reproduce

      1. Perform a Cloud Space export. Check if the entities.xml file contains email addresses stored in ConfluenceUserImpl->name fields.
      2. Perform a Space import, do not check the "Attribute content ..."
      3. Observe all the content has been attributed to "Unknown Users"
      4. Delete the imported Space
      5. Perform a Space import again, this time check the "Attribute content ..." checkbox.

      Expected Results

      After second import, all of the content that had corresponding users in Server, should be properly attributed to them (e.g. properly display page creators, commenters, etc.)

      Actual Results

      After second import, all of the content in imported Space remains attributed to Unknown Users.

      Workaround

      To recover from such failed import, you must remove the unnecessary entries from the USER_MAPPING table.

      To do that, only delete these which match an email address and are NOT usernames in the cwd_user table: 

      1. Make sure the problematic Space is deleted
      2. Execute the following query: 
      delete from user_mapping where username like '%@%' and username not in (select user_name from cwd_user);

              lgrzyb lukasz
              lgrzyb lukasz
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: