Migrate On-Premises Data to Amazon S3 Securely
Secure on-premises to S3 migration: DataSync, Transfer Family, Data Transfer Terminal, SSE-KMS, TLS-only policies, IAM roles and integrity checks.
To migrate on-premises data to Amazon S3 securely, classify the data first, give the transfer tool a least-privilege IAM role, send everything over TLS (ideally through a VPC endpoint or AWS Direct Connect), encrypt at rest with SSE-S3 or SSE-KMS, verify integrity after the copy, and log every action in CloudTrail before you cut over. The tool you pick, usually AWS DataSync, decides how much of that you get for free.
This guide walks through the full process for a DevOps or cloud engineer who has been handed a file server, NAS or backup share and told to move it to S3 without leaking anything. It is part of our S3 series; if you need the basics of buckets and storage classes first, start with What is Amazon S3.
Key takeaways
- AWS DataSync is the default choice for online migrations from NFS, SMB, HDFS or self-managed object storage. It encrypts data in transit and validates integrity during the transfer.
- AWS Snowball Edge is no longer available to new customers. AWS now points new customers to DataSync for online transfers and AWS Data Transfer Terminal for physical, offline transfers.
- Since 5 January 2023, every new object written to S3 is encrypted with SSE-S3 by default. Choose SSE-KMS when you need key-level access control and audit.
- Block Public Access, a bucket policy that denies non-TLS requests, and a dedicated IAM role for the migration tool close most of the common gaps.
- Verification is part of the migration. Plan for a checksum or DataSync verification pass and a reconciliation report before you delete anything on premises.
Step 1: Classify and size the data before you pick a tool
Most failed migrations go wrong before a single byte moves. Teams start a copy job, discover halfway through that a folder contains payroll exports or patient scans, and then have to stop, re-scope and explain why sensitive data sat in a bucket with default settings.
Spend the first days on an inventory. For each share or directory, record:
- Total size and file count. Millions of small files behave very differently from a few large backup images.
- Data owner and sensitivity: public, internal, confidential or regulated.
- Change rate. A folder that changes every hour needs incremental syncs and a cutover window; an archive can move once.
- Retention and legal hold requirements, which decide whether you need S3 Object Lock or versioning.
- Which applications read or write it, so you know who breaks at cutover.
The sensitivity column drives everything that follows: which bucket the data lands in, which KMS key protects it, who can read it and how long logs are kept. Regulated data should go to its own bucket with its own key rather than a shared "migration" bucket.
Step 2: Choose the transfer method
AWS offers several ways to get data into S3. The right one depends on how much data you have, how good your network link is and whether the source must stay live during the move.
| Method | Best for | Security points |
|---|---|---|
| AWS DataSync | Online migration from NFS, SMB, HDFS or S3-compatible object storage; repeated incremental syncs | Encryption in transit, built-in data integrity validation, IAM role access to S3, VPC endpoint support |
| AWS Transfer Family | Partners or applications that already push files over SFTP, FTPS, FTP or AS2 | Managed endpoint in front of S3 or EFS; prefer SFTP or FTPS over plain FTP |
AWS CLI (aws s3 sync) | Small, one-off copies or scripted jobs from a single host | HTTPS by default; you build verification and retry handling yourself |
| AWS Data Transfer Terminal | Large datasets on portable storage when the network is too slow | You bring your own devices to a secure AWS facility and upload in a private setting |
| AWS Snowball Edge | Existing Snow customers only | No longer offered to new customers |
As a rough rule, if your link can move the data inside the project window, use DataSync. AWS states that a single DataSync task can fully use a 10 Gbps link, and suggests a temporary AWS Direct Connect hosted connection when bandwidth is the constraint. If the network cannot get there in time, plan for Data Transfer Terminal or an AWS Partner offline service.
Step 3: Prepare the landing zone in S3
Build the destination before the copy starts, and build it with infrastructure as code so the settings are reviewable. A secure landing bucket usually has these settings:
- S3 Block Public Access enabled at both account and bucket level.
- Object Ownership set to bucket owner enforced, which disables ACLs so access is controlled only by policies.
- Default encryption with SSE-KMS and a customer managed key for confidential data. Enable S3 Bucket Keys to cut KMS request volume.
- Versioning turned on, so an accidental overwrite during repeated syncs can be undone.
- A bucket policy that denies requests without TLS, using the
aws:SecureTransportcondition key. - Server access logging or CloudTrail data events so every object write during the migration is recorded.
Here is a bucket policy statement that rejects any request not made over HTTPS:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyInsecureTransport",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::example-migration-bucket",
"arn:aws:s3:::example-migration-bucket/*"
],
"Condition": {
"Bool": { "aws:SecureTransport": "false" }
}
}
]
}
Encryption deserves a note. S3 applies SSE-S3 (AES-256) to all new object uploads automatically since 5 January 2023, at no extra cost, and you cannot turn it off. That means the data is never stored unencrypted. The question is whether SSE-S3 is enough. SSE-KMS adds a separate permission layer: a reader needs both s3:GetObject and permission to use the KMS key, and every decrypt is logged in CloudTrail. For regulated data that extra control is usually worth the cost. Our post on how S3 object encryption works compares the options in detail.
Step 4: Lock down identity for the migration
The migration tool needs write access to the bucket and nothing else. Create a dedicated IAM role for DataSync (or for the host running the CLI) and scope it to the destination bucket and prefix. Avoid long-lived access keys on the on-premises server; if a script must run there, use short-term credentials through IAM Identity Center or IAM Roles Anywhere.
A few habits help:
- Separate the role that writes migration data from the roles that applications will use to read it later.
- Add the KMS key permissions (
kms:GenerateDataKey,kms:Decrypt) only for the specific key. - Review the role with IAM Access Analyzer before go-live and remove it after cutover.
If IAM policy JSON is new to you, read how to write IAM policies for fine-grained access before you build this role.
Step 5: Secure the network path
DataSync encrypts traffic between its agent and the AWS service with TLS. You decide which network that traffic crosses. The options, from simplest to most private:
- Public service endpoints over the internet. Encrypted, but your firewall must allow outbound traffic to AWS endpoints.
- VPC endpoints. DataSync supports VPC endpoints, so the agent talks to DataSync through private IP addresses in your VPC, reached over a VPN or Direct Connect.
- AWS Direct Connect. A dedicated link that keeps traffic off the public internet and gives more predictable throughput for large transfers.
For regulated data, VPC endpoints over a site-to-site VPN or Direct Connect are the usual choice, because you can then restrict the bucket to requests from that endpoint with the aws:SourceVpce condition key.
Step 6: Run the transfer with DataSync
A DataSync migration has three parts: an agent deployed close to the source storage, a source location (for example an SMB share) and a destination location (the S3 bucket). A task ties them together with options for verification, filtering, scheduling and bandwidth limits.
The CLI flow looks like this once the agent is activated:
# Source: an on-premises NFS export reached through the agent
aws datasync create-location-nfs \
--server-hostname nas01.example.internal \
--subdirectory /exports/finance \
--on-prem-config AgentArns=arn:aws:datasync:ap-south-1:111122223333:agent/agent-0123456789abcdef0
# Destination: the S3 bucket, accessed through a dedicated IAM role
aws datasync create-location-s3 \
--s3-bucket-arn arn:aws:s3:::example-migration-bucket \
--subdirectory /finance \
--s3-config BucketAccessRoleArn=arn:aws:iam::111122223333:role/datasync-migration-role
# Task that verifies transferred data and logs to CloudWatch
aws datasync create-task \
--source-location-arn arn:aws:datasync:ap-south-1:111122223333:location/loc-0123456789abcdef0 \
--destination-location-arn arn:aws:datasync:ap-south-1:111122223333:location/loc-0fedcba9876543210 \
--cloud-watch-log-group-arn arn:aws:logs:ap-south-1:111122223333:log-group:/datasync/finance \
--options VerifyMode=ONLY_FILES_TRANSFERRED,LogLevel=TRANSFER
Run a small pilot first: one directory with representative file types and sizes. Measure throughput, check that permissions and metadata arrived the way you expect, and confirm that the logs show what you need for an audit. Then schedule the full run, followed by incremental runs that only copy changed files until cutover.
Throttle the task during business hours if the link is shared. A migration that saturates the office uplink tends to get cancelled by someone outside the project.
Step 7: Verify integrity and reconcile
Verification turns "we copied it" into "we can prove it arrived intact". DataSync performs integrity checks during transfer and can verify data after the copy. For CLI-based copies, compare checksums yourself: S3 supports additional checksum algorithms such as CRC32, CRC32C and SHA-256 on upload, which you can compare with values computed at the source.
Produce a reconciliation report for the data owner:
- File count and total bytes at source vs destination.
- List of files skipped or failed, with the reason.
- Sample of files opened by the application team to confirm they are usable.
- Encryption status, which S3 Inventory can report per object.
Only after the owner signs off should you plan decommissioning on premises, and even then keep the source read-only for an agreed period.
Step 8: Cut over and harden for daily use
At cutover, freeze writes to the source, run a final incremental sync, verify again and switch applications to S3. Then shift from "migration" settings to "production" settings:
- Remove or disable the migration IAM role and the DataSync task.
- Apply lifecycle rules to move cold data to cheaper classes. See S3 lifecycle rules for the options.
- Turn on Object Lock for records that must not be changed, if retention rules require it. Access logging and Object Lock covers the setup.
- Set CloudWatch alarms or S3 Storage Lens reviews for unexpected growth or access patterns.
Common problems and how to fix them
| Symptom | Likely cause | Fix |
|---|---|---|
| Task fails with access denied on S3 | Bucket access role missing a permission or KMS key policy does not allow the role | Check the role policy and the key policy together; KMS denials look like S3 denials |
| Throughput far below link speed | Agent undersized, many tiny files, or a firewall inspecting TLS traffic | Resize the agent VM, split the task by directory, exclude the agent traffic from inspection |
| Requests rejected after adding a bucket policy | Deny statement on aws:SecureTransport or aws:SourceVpce blocks the path you use | Confirm the request path; test from the agent network before the full run |
| Files present but application cannot read them | Reader role lacks KMS permissions | Grant kms:Decrypt on the key to the application role |
| Counts do not match after the run | Files changed or were locked during transfer | Read the task log, rerun an incremental sync, and verify again |
A short checklist
- Inventory and classify every source share.
- Pick the transfer method from data size, network speed and change rate.
- Create the bucket with Block Public Access, ownership enforced, SSE-KMS where needed, versioning and a TLS-only policy.
- Create a dedicated, least-privilege role for the transfer.
- Choose the network path: public endpoint, VPC endpoint or Direct Connect.
- Pilot one directory, then run full and incremental syncs.
- Verify, reconcile and get owner sign-off.
- Cut over, remove migration access, apply lifecycle and retention rules.
Choosing DataSync options for a migration
DataSync tasks have sensible defaults, but a few options deserve a deliberate choice before the first full run, because they change what you can prove later.
Verification mode is the first. ONLY_FILES_TRANSFERRED calculates a checksum of each transferred file at the source and compares it with the destination at the end of the run. AWS recommends it, and it is the default for Enhanced mode tasks. POINT_IN_TIME_CONSISTENT checks the whole source and destination for full synchronisation; it is the Basic mode default but cannot be used when writing to S3 Glacier Flexible Retrieval or Glacier Deep Archive. NONE keeps only the in-flight integrity checks, which is rarely what an auditor wants to hear.
Transfer mode is the second. The default, CHANGED, copies only data and metadata that differ after the first full copy, which is what makes repeated incremental runs before cutover cheap. ALL copies everything every time.
Third, think about deletes. PreserveDeletedFiles defaults to keeping files at the destination even when they disappear from the source. That is the safer choice during a migration. Switching it to REMOVE mirrors deletions, but it can trigger minimum storage duration charges on some storage classes and cannot be combined with transfer mode ALL.
Finally, set LogLevel to TRANSFER for the migration window so CloudWatch Logs records every file transferred and checked, and use BytesPerSecond to cap bandwidth during office hours. You can override options for a single execution, so a weekend run can use the full link while weekday runs stay throttled.
Where to practise this
You can rehearse the whole flow in a personal AWS account with a small Linux VM acting as the NFS source. Our AWS Solutions Architect Associate course covers S3, IAM, KMS and hybrid networking with hands-on labs, in our Kharadi, Pune classroom or live online from anywhere in India.
Frequently asked questions
What is the most secure way to move on-premises data to S3?
For most teams it is AWS DataSync with a least-privilege IAM role, traffic through a VPC endpoint over VPN or Direct Connect, SSE-KMS on the destination bucket, a TLS-only bucket policy and verification enabled on the task. CloudTrail then records who did what.
Is data encrypted in S3 by default?
Yes. Since 5 January 2023, S3 encrypts all new object uploads with SSE-S3 at no extra cost, and you cannot disable it. Objects uploaded before that date into unencrypted buckets are not encrypted retroactively.
Can I still order an AWS Snowball device?
Not as a new customer. AWS says Snowball Edge is no longer available to new customers and recommends DataSync for online transfers or AWS Data Transfer Terminal for physical transfers. Existing Snowball customers are not affected.
Does DataSync encrypt data in transit?
Yes. DataSync encrypts data moving between the agent and AWS and validates data integrity. You can also keep the traffic private by using VPC endpoints.
When should I use AWS Transfer Family instead of DataSync?
Use Transfer Family when people or systems already send files with SFTP, FTPS, FTP or AS2 and you want them to keep doing so, with S3 or EFS behind the endpoint. Use DataSync to bulk-move existing data from file shares.
How do I prove the migration was complete?
Compare file counts and bytes, review the DataSync task log for skipped files, check per-object encryption with S3 Inventory, and have the data owner test a sample of files before you retire the source.
Should I use SSE-S3 or SSE-KMS for migrated data?
SSE-S3 is fine for low-sensitivity data. Use SSE-KMS with a customer managed key for confidential or regulated data, because it adds key-level permissions and CloudTrail logging of every decrypt.
References
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0