Resolve invalid email addresses when migrating to the Cloud

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Data Center のみ - この記事は、Data Center プラットフォームのアトラシアン製品にのみ適用されます。

要約

When migrating from Server or Data Center to Cloud, the Migration Assistant apps run a set of pre-checks to verify the source instance doesn’t include users with invalid email addresses. Since an email address is the primary identifier in Cloud, it must be valid. Migrated content from Jira and Confluence will be linked to users in Cloud based on their email addresses.

Identify

Use one of the following ways to identify users with invalid email addresses.

Identify users automatically in the Jira Cloud Migration Assistant

You can use the Migration Assistant to assess your users and identify those whose email addresses don’t meet the requirements. You can complete this assessment at any time before migration.

To identify users with invalid addresses:

  1. Open the Jira Cloud Migration Assistant.

  2. In the Assess and prepare users section, select Begin assessing. You’ll be moved to the page with empty results.

  3. To start the assessment, select Begin assessing.

Once the assessment is complete, you’ll see the results, including invalid email addresses and duplicated email accounts, like in the following example:

For more information about the assessment and next steps, see Assess and prepare your users for migration.

Identify users in the Confluence Cloud Migration Assistant

For Confluence, the assessment mentioned above is not available. However, you can create a new migration plan and run the pre-checks to scan the source instance. If there are invalid email addresses you will see the following:

Identify users in the database

You can also identify users with invalid email addresses by running the following queries in your database:

Postgres

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;

Oracle

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;

MySQL

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;

MS SQL Server

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;
NOTE: The SQL query may need to be adjusted depending on the database. Also, the query makes the assumption that the column email_address and lower_email_address have consistent data.

ソリューション

You can either fix the email addresses manually in your source user directory or choose one of the automatic options from the Migration Assistant to update the users during migration.

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.

Manually create valid emails and update them in your user directory

You can manually create email addresses that are valid (e.g. user@atlassian.com) and update them in your user directory, be it an LDAP Server or your Server or Data Center instance.

To update email addresses of users in your Server or Data Center instance:

  1. Select Administration > User management.

  2. Find the user you’d like to update using the filters at the top of the page.

  3. Select Edit next to the username.

  4. Update the email address, and select Update.

Automatically update users during migration (Jira only)

This option is only available in the Jira Cloud Migration Assistant.

After you complete the assessment described in the Identify users automatically in the Migration Assistant section, the Migration Assistant will let you fix invalid email addresses as the next step. Note that if you choose this approach, we won’t update users in your source directory, but only the ones we create in Cloud during migration.

These automatic fixes should be applied to unimportant accounts, such as old or testing ones. Actual users who will be working in Cloud should be updated in your user directory.

To automatically fix invalid email addresses:

  1. In the Migration Assistant, view the results in the Assess and prepare users section.

  2. When viewing the results, select Fix invalid emails.

  3. Choose one of the options to fix invalid emails. For more information on each option, see Fix invalid email addresses.

Manually update users in the database

You can update users directory in the database. These queries will update the email address of every user whose address is invalid, using the following format: invaliduser-<id>@domain.com.

Make sure to adjust the queries by adding a specific domain or changing the format. Once you’re done, either restart your Server or Data Center instance.

Postgres

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]+$');

Oracle

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'));

MySQL

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_-]+\.?)+$';

MS SQL Server

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);
最終更新日: 2022 年 12 月 8 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.