Why the timing matters more than the document
| Decision | Cost before migration | Cost after migration |
|---|---|---|
| Region and data location | Pick a region when provisioning | Copy everything again, including backups and replicas; the transfer has already happened |
| Encryption key custody | Choose provider-managed or customer-managed keys at creation | Often means re-encrypting or recreating buckets, volumes, or database instances, depending on the provider |
| Data scope | Leave unneeded columns out of the export | Delete them from production, snapshots, and logs |
| Access design | Define roles and private networking up front | Remove grants and public endpoints that applications already depend on |
| Logging and retention | Decide what gets logged and for how long | Find and purge personal data already sitting in logs |
Step 1: inventory the personal data in the source
app_db and the pattern to match your schema.
SQL
-- Columns whose names suggest personal data
SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = 'app_db'
AND COLUMN_NAME REGEXP 'email|phone|address|birth|national_id|passport';
-- Accounts allowed to connect from any host
SELECT user, host FROM mysql.user WHERE host = '%';
-- Tables encrypted at rest (MySQL with InnoDB encryption and a keyring configured)
SELECT TABLE_SCHEMA, TABLE_NAME, CREATE_OPTIONS
FROM information_schema.TABLES
WHERE CREATE_OPTIONS LIKE '%ENCRYPTION%';host = '%' query shows which accounts can connect from anywhere. Migration scripts tend to copy these accounts as they are. Decide now whether each one should exist on the new platform.
Step 2: check region and key custody on the target before loading data
BASH
# Region of the bucket (null or empty means us-east-1)
aws s3api get-bucket-location --bucket your-bucket-name
# Is the bucket replicated somewhere else?
aws s3api get-bucket-replication --bucket your-bucket-name
# Default encryption and which key it uses
aws s3api get-bucket-encryption --bucket your-bucket-name
# Who manages that key: 'AWS' or 'CUSTOMER'
aws kms describe-key --key-id your-key-id --query 'KeyMetadata.KeyManager'
# Is public access blocked on the bucket?
aws s3api get-public-access-block --bucket your-bucket-name
# Database placement, encryption, key, and public exposure
aws rds describe-db-instances --query 'DBInstances[*].[DBInstanceIdentifier,AvailabilityZone,StorageEncrypted,KmsKeyId,PubliclyAccessible]' --output tableStep 3: check the access paths on both sides
BASH
# Listening addresses (0.0.0.0 or [::] means all interfaces)
sudo ss -tlnp | grep -E ':3306|:5432'
# Is TLS required, and does the current session use it? (empty Ssl_cipher means no)
mysql -e "SHOW VARIABLES LIKE 'require_secure_transport'; SHOW SESSION STATUS LIKE 'Ssl_cipher';"require_secure_transport set to OFF is common on older single-server setups, where the app and database share one machine. After a migration, the app and database often end up on different hosts or services, so the traffic between them now crosses a network. Decide before the move whether that link needs TLS or a private network. Retrofitting TLS later means touching every application connection string under production load.
Save the output, then rerun it after cutover
aws s3api get-bucket-encryption --bucket your-bucket-name > before-encryption.txt. Attach the files to the DPIA as evidence of the configuration you assessed. After go-live, run the same commands into after-*.txt files and compare them with diff before-encryption.txt after-encryption.txt.
The post-cutover diff catches drift that happens during migration itself. Typical examples are a temporary bucket created by a transfer tool and never removed, a '%' grant added at 2 a.m. to get the app connecting, or debug logging switched on that writes request bodies containing personal data. None of these show up in a document review. They show up when you run the same check twice. If you need a wider post-migration review, this piece on skipped UU PDP technical audits covers what usually breaks.
In practice, treat the DPIA as part of the migration plan, scheduled before the data copy, and back it with command output from the actual target environment. Settle region, replicas, key custody, data scope, and access before loading anything. Then rerun the same checks after cutover and record the differences. Every item you settle before the move is a second migration you won't need later.