@@ -4,16 +4,17 @@ title: Normalize phone numbers to E.164
44sidebar_label : Normalize phone numbers
55---
66
7- Starting with this release, Ory Kratos normalizes phone numbers to [ E.164 format] ( https://en.wikipedia.org/wiki/E.164 ) when
8- they're used as identifiers, verifiable addresses, or recovery addresses. New data is normalized on write. Existing data continues
9- to work through a backward-compatible lookup, but you should run the ` normalize-phone-numbers ` migration command after upgrading
10- to converge all rows to E.164.
7+ Ory Kratos normalizes phone numbers to [ E.164 format] ( https://en.wikipedia.org/wiki/E.164 ) when they're used as identifiers,
8+ verifiable addresses, or recovery addresses. New data is normalized on write. Existing data continues to work through a
9+ backward-compatible lookup, but you should run the ` normalize-phone-numbers ` migration command after upgrading to converge all
10+ rows to E.164.
1111
1212This guide is for self-hosted Kratos administrators (OSS and OEL). Ory Network customers don't need to take any action.
1313
14- :::info
14+ :::important
1515
16- Back up your database before running the migration.
16+ Back up your database before running the migration. The migration doesn't store the original value, therefore there's no automatic
17+ rollback after migration. To revert, you will need to restore your backed-up database.
1718
1819:::
1920
@@ -28,6 +29,14 @@ the user formatted the input.
2829
2930## Rollout sequence
3031
32+ :::caution
33+
34+ Don't run the migration before deploying the new Kratos version. The previous version does exact-string matching on identifiers.
35+ If you normalize the database first, users who type their phone number in the original (non-E.164) format won't be able to log in
36+ until the new code is deployed.
37+
38+ :::
39+
3140Run the steps in this exact order:
3241
33421 . ** Deploy the new Kratos version.**
@@ -51,14 +60,6 @@ Run the steps in this exact order:
5160 The command iterates over ` identity_credential_identifiers ` , ` identity_verifiable_addresses ` , and ` identity_recovery_addresses `
5261 and rewrites any non-E.164 phone numbers in place.
5362
54- :::caution
55-
56- Don't run the migration before deploying the new Kratos version. The previous version does exact-string matching on identifiers.
57- If you normalize the database first, users who type their phone number in the original (non-E.164) format won't be able to log in
58- until the new code is deployed.
59-
60- :::
61-
6263## What the command does
6364
6465The command uses keyset pagination to scan three tables in batches:
0 commit comments