Invalid email addresses in the migration user assessment check
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
How to identify and correct invalid email addresses using either the migration assistant or making direct changes through the database.
Overview
When migrating from server or Data Center to the cloud, the Migration Assistant apps perform a series of pre-checks to make sure that the source instance doesn't contain users with invalid email addresses. As the email address serves as the primary identifier in the cloud, it is essential for it to be valid. Content migrated from Jira and Confluence will be associated with users in cloud based on their email addresses.
The Migration Assistant identifies individuals with email addresses that don't meet the necessary criteria. This assessment can be conducted at any stage prior to the migration process.
Detect Invalid Email Addresses
The following section outlines the steps to identify invalid email addresses on the server or Data Center.
With the help of Jira Cloud Migration Assistant
To identify users with invalid addresses using JCMA, follow the steps below:
- In Jira server or Data Center, go to Jira Administration > System
In the left panel, locate the Import and Export category, and select Migrate to cloud. The Migration Assistant home screen appears.
- Find the Assess and prepare your users card and click on Begin assessing
- Connect to your destination cloud site:
If you already have a cloud site, select Choose cloud site or choose it from the drop-down.
- If you don’t have a cloud site yet, select Get Jira cloud trial to try one for free. Learn more about Cloud migration trials
- Click on Begin assessing. This will take you to a page with empty results
- To initiate the assessment, select Begin assessing once again
Once the assessment is complete, the results will be visible, including any invalid email addresses. The screenshot provided below gives a clear representation of the assessment's findings.
With the help of Confluence Cloud Migration Assistant
To identify users with invalid addresses using CCMA, follow the steps below:
Go to Confluence Administration > look for the Atlassian Cloud category > select Migration Assistant. The Migration Assistant home screen appears
Find the Assess and prepare your users card and click on it.
- Connect to your destination cloud site:
If you already have a cloud site, select Choose cloud site or choose it from the drop-down.
- If you don’t have a cloud site yet, select Get Confluence cloud trial to try one for free. Learn more about Cloud migration trials
Click on Begin assessing. This will take you to a page with empty results.
To initiate the assessment, select Begin assessing once again.
Once the assessment is complete, the results will be visible, including any invalid email addresses. The screenshot provided below gives a clear representation of the assessment's findings.
From the server/DataCenter Database
NOTE: The SQL query may require adjustments based on the specific database being used. Additionally, it assumes that the columns email_address and lower_email_address contain consistent data.
Invalid email addresses can be identified by executing the following queries in the database:
SELECT email_address
, user_name
FROM cwd_user
WHERE email_address !~ '^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+[.][A-Za-z]+$'
OR length(substring(email_address from '(.*)@')) > 64
OR email_address IS NULL;
SELECT email_address
, user_name
FROM cwd_user
WHERE NOT REGEXP_LIKE (email_address, '^[A-Za-z0-9\.\!\#\$\%\&\''\*\+\-\/\=\?\^\_\|\~\(\)]+@([A-Za-z0-9_-]+\.?)+$', 'i')
OR instr(email_address, '@') > 64
OR email_address IS NULL;
SELECT email_address
, user_name
FROM cwd_user
WHERE email_address NOT REGEXP '^[A-Za-z0-9\.\!\#\$\%\&\'\*\+\-\/\=\?\^\_\|\~\(\)]+@([A-Za-z0-9_-]+\.?)+$'
OR LENGTH(substring_index(email_address, '@', 1)) > 64
OR email_address IS NULL;
SELECT email_address
, user_name
FROM cwd_user
WHERE NOT email_address LIKE '%_@%__%.__%'
OR NOT PATINDEX('%[^a-z,0-9,@,.,_,\-]%', email_address) = 0
OR charindex('@', email_address) > 64
OR email_address IS NULL;
Fix Invalid Email Addresses
The invalid email addresses can be fixed by the following method:
- Manually on the source user directory.
- Directly on the UI of server or Data Center instance
- The automatic options from the Migration Assistant can be chosen to update the users during the migration.
- Alternatively, the data can be updated manually in the database of the server/Datacenter.
Manually on the source user directory.
Create valid email addresses (e.g. user@atlassian.com) and update them in the user directory, whether it is an LDAP server or server/Data Center instance.
Directly on the UI of server or Data Center instance
- On the Jira server or Data Center instance:
Select Administration > User management.
Find the user you’d like to update using the filters at the top of the page.
Select Edit next to the username.
Update the email address, and select Update.
- On the Confluence server or Data Center instance:
Select Administration > User management.
Find the user you’d like to update using the filters at the top of the page.
Click on the User > Edit details
Update the email address, and select Submit.
Using Migration Assistant
After performing the assessment outlined in the "Detect Invalid Email Address" section, the Migration Assistant will proceed to correct any invalid email addresses. It's crucial to understand that this method only impacts accounts created in the cloud during migration and does not modify the source directory. The automated adjustments are targeted at non-critical accounts, like old or testing ones, while updates for active users working in the cloud should come from your user directory.
To automatically fix invalid email addresses:
In the Migration Assistant, view the results in the Assess and prepare your users section.
When viewing the results, select Fix invalid emails.
Choose one of the options to fix invalid emails. For more information on each option, see
Manually update users in the database
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
The following query will update all those invalid users to the format: invaliduser-<id>@domain.com
Make sure to adjust the queries by adding a specific domain or changing the format. Once completed, restart the Server or Data Center instance.
UPDATE cwd_user
SET email_address = 'invaliduser-' || id || '@domain.com',
lower_email_address = 'invaliduser-' || id || '@domain.com'
WHERE lower_email_address IN (SELECT lower_email_address FROM cwd_user WHERE lower_email_address !~ '^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+[.][A-Za-z]+$');
UPDATE cwd_user
SET email_address = 'invalideuser-' || id || '@domain.com',
lower_email_address = 'invalideuser-' || id || '@domain.com'
WHERE lower_email_address in (SELECT lower_email_address
FROM cwd_user
WHERE NOT REGEXP_LIKE (lower_email_address, '^[A-Za-z0-9\.\!\#\$\%\&\''\*\+\-\/\=\?\^\_\|\~\(\)]+@([A-Za-z0-9_-]+\.?)+$', 'i'));
UPDATE cwd_user
SET email_address = 'invalideuser-' || id || '@domain.com',
lower_email_address = 'invalideuser-' || id || '@domain.com'
WHERE email_address NOT REGEXP '^[A-Za-z0-9\.\!\#\$\%\&\'\*\+\-\/\=\?\^\_\|\~\(\)]+@([A-Za-z0-9_-]+\.?)+$';
UPDATE cwd_user
SET email_address = CONCAT('invaliduser-',id,'@domain.com'),
lower_email_address = CONCAT('invaliduser-',id,'@domain.com')
WHERE lower_email_address in (SELECT lower_email_address
FROM cwd_user WHERE not lower_email_address LIKE '%_@__%.__%'or not PATINDEX('%[^a-z,0-9,@,.,_,\-]%', lower_email_address) = 0);