Migrating Records between Countries
The InCountry Data Residency for Salesforce package supports the migration of records between countries.
The package supports two scenarios for data migration:
-
Migration of a record from one country to another on the InCountry platform.
-
Removal of the record from the InCountry platform in a specific country and its migration to Salesforce along with its protected fields.
Prerequisites
-
Migration of records works only at the record restriction level.
-
At the record restriction level, you need to have multiple countries registered.
-
For each country, you need to have a dedicated endpoint registered in the package.
Migrating a record from one country to another
This functionality is supported in the legacy package and in the three-model package for all models.
When you want to migrate a record between countries, please avoid modifying other fields within this record. After changing the field storing the country where the record is retained, the package initiates the migration process. All other values that you change within the same edit operation will not be applied. Please modify the record’s values only after completion of the cross-country record migration.
-
Open the record that you want to migrate between countries.
-
Locate the field which regulates the country where the record is stored.
-
Click the pencil icon to edit this field.
-
In the field, enter the country to which the record is migrated.
-
Click Save.
-
The package will prompt you to confirm the migration of the record. Click Change country.
-
The record migration starts. Wait for a while as migration may take some time.
-
Upon the successful migration, you will see a screen similar to the following one.
-
To close the Record migration form, click OK.
The record with regulated data will be migrated from the source country to the destination country.
During migration, the record goes through the following stages:
-
Record validation: Apex Code checks the input parameters, validates the current record policy, checks the new record policy, and if everything is fine initiates the migration between countries.
-
Find Record in InCountry: a record is checked on the InCountry platform in the country where it is currently stored.
-
Write to InCountry: a record is being written to the InCountry platform in the destination country.
-
Delete from InCountry: a record is deleted from the country where it was initially stored only after the successful migration to the destination country.
-
Migrated: the successful response is received from the Apex Code side.
Restoring the record in Salesforce and deleting it from the InCountry platform
This functionality is supported in the three-model package for all models.
This scenario will be executed automatically in the following situations:
-
You enter the country which is not registered at the record restriction level.
-
You clear the country in the field which regulates the country for record retention.
-
Open the record that you want to delete from the InCountry platform and restore it in Salesforce.
-
Locate the field which regulates the country where the record is stored.
-
Click the pencil icon to edit the field.
-
In the field, enter the country to which the record is migrated or clear the field.
-
Click Save.
-
The package will prompt you to confirm the removal of the record. Click Change country.
-
The record migration starts. Wait for a while as it may take some time.
-
Upon the successful removal from the InCountry platform and record recovery in Salesforce, you will see a screen similar to the following one.
-
To close the form, click OK.
Regulated data of the record will be restored in Salesforce.
During migration, the record goes through the following stages:
-
Record validation: Apex Code checks the input parameters, validates the current record policy, checks the new record policy, and if everything is fine initiates the migration between countries.
-
Find Record in InCountry: a record is checked on the InCountry platform in the country where it is currently stored.
-
Delete from InCountry: a record is deleted from the InCountry platform in the country where it was initially stored.
-
Restore in Salesforce: all the values in protected fields are restored in Salesforce on the basis of values stored on the InCountry platform.
-
Migrated: the successful response is received from the Apex Code side.
Migrating multiple records
-
On the list view, select multiple records.
-
Update the field that regulates the country where the record is stored.
-
Follow the steps described above.