A common plan for cloud migrations goes like this: move the data, get the new stack stable, then fill in the data protection impact assessment (DPIA) for UU PDP once things calm down. The assessment looks like a document, and documents feel like they can wait. But a DPIA exists mostly to shape design decisions, and several of those decisions stop being cheap the moment personal data lands on the new platform. A more useful question than "before or after" is: what can we still change right now?
Why the timing matters more than the document
A DPIA is a structured review of one processing activity. It records what personal data is involved, why you process it, who can touch it, where it is stored and sent, what could go wrong for the people it belongs to, and what you will do about those risks. Law No. 27 of 2022 on Personal Data Protection (UU PDP) expects controllers to carry out an impact assessment when processing carries a high potential risk to data subjects. Confirm the exact article and any implementing rules with whoever handles legal compliance for you.
On timing, the UK regulator is direct. The ICO's guidance on when to do a DPIA says the assessment should happen before the processing starts. UU PDP is a different law, but the same reasoning applies. An assessment written after go-live can only describe risks that already exist. It cannot prevent them.
In technical terms, migration decisions fall into two groups. Some you can adjust at any time, such as a firewall rule or a password policy. Others are fixed by where and how the data was first written:
| 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 |
At the support desk, the after-the-fact version of this usually arrives as a request to "just move the bucket to another region" or "switch to our own keys." Both requests amount to a second migration.
The rest of this guide covers read-only checks you can run before the move, save as evidence for the DPIA, and run again after cutover.
Step 1: inventory the personal data in the source
You can't assess risk for data you haven't listed. If the source is MySQL or MariaDB, start with column names and access grants. Change app_db and the pattern to match your schema.
-- 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%';
Matching on column names is only a starting point. Free-text columns such as notes, comments, or JSON metadata often hold phone numbers and addresses that no column name reveals, so sample a few rows from those tables too. The main question here is which columns don't need to move at all. Dropping a column from the export takes one line. Removing it later from a live database plus every snapshot is a project.
The 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
Run this step against the empty target environment. Every cloud provider has its own CLI. The commands below are for AWS, and other providers have equivalents in their documentation. Each command only reads configuration.
# 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 table
The replication check catches a common surprise. The primary bucket sits in the region you chose, while a replica or backup copy goes to a region nobody discussed. For the DPIA, record every location a copy of the data will exist in, not just the primary.
The key custody check is easy to skip, because "encrypted: true" looks like the end of the story. Whoever controls the key decides who can read the data, and on many services that choice is locked in when the storage is created. If you plan to hold your own keys, set that up before the first byte arrives. This article on key custody covers what to look for in more detail.
An error from any of these commands also tells you something. For example, no encryption configuration found, or no public access block set. Write those errors down. They belong in the assessment as findings.
Step 3: check the access paths on both sides
On self-managed servers, check what the database listens on and whether connections are encrypted in transit. Run this on the source server now and on the target server once it is built.
# 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';"
A database bound to all interfaces with 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
Redirect each check into a dated file, for example 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.