How to migrate files from web server to S3?

,

Hello, I need some help regarding this issue I have. Keep in mind I have little experience with AWS (less than a month) so I’m still considered a newbie.

Our company is already in the process of migrating our websites from a dedicated server to AWS. New websites have been created in our EC2 instance.

However old websites need to be migrated over, but decoupling their files and route these into S3.

He wave a wordpress installation with uploaded content of about 20 GB, so these are a lot of small files in reality.

What would be the best way to transfer all of these files over to S3? I tried testing this by downloading all of the files to my local computer and trying to upload to S3 through the interface, and it gave me a whooping ~30 days estimated time because it was uploading files at a 6 KB/s seed despite having optical fiber of up to 50 GB upload speed, so that’s a big no. This migration needs to happen in the next 72 hours or less.

I looked up DataSync but I’m at a loss with the deploying agent thing, I don’t know what to do with it, and I have no idea if it’ll work. Our dedicated server currently runs on a LAMP stack with cPanel installed on it, our websites running just fine.

How would I go if I want to make use of DataSync? Or if there are any other different services that could help in this situation?

Please, I’m getting kinda desperate on this topic, as I need to have it resolved ASAP.

Excuse my english, it’s not my mother tongue. Thank you very much in advance.

Create a VPC endpoint for s3 I where your ec2 instance is running. Natively on the server, use the AWS cli to upload the files directly to s3.

Use a Wordpress plugin to upload the files to s3 and/or use a static site plugin to convert the website to HTML [1].

But I don’t think you can do much with the local wp-content directory as it’s required for Wordpress to run (media editor etc).

Running Wordpress in AWS can get expensive maybe move it to a lightsail instance or move to another shared host?

[1] https://wplift.com/wordpress-static-site-generator-tutorial

Use the AWS CLI to upload the files from the web server to S3, make sure to use multipart upload as this is the recommended way to upload files larger than 100kb to S3 and will also be faster than doing them in one stream.

I will look into this, perhaps something happened then, and it’s worth a shot retrying.

You mean natively in my EC2 instance, copy all of the external files (the dedicated server) using AWS CLI to upload them directly into S3?

This AWS CLI has to be ran in the dedicated server right? Pointing to my S3 and copying over all of the files.

Yeah that’s correct, install the AWS CLI on your web server, and then transfer the files from there pointing at your bucket. Making sure the account you use on the CLI has the correct permission on AWS to interact with the bucket.

Yes.

You might try using an S3 capable transfer client like Panic Transit or Cyberduck. You wouldn’t install this on the web server, but a client with network access to the file system of your web server

Second enzy20k. If your are next to your server and don’t want to install software on it, map the drive (or NFS mount) from another system that has the CLI. 20 GB should be quick with your circuit (we do PB workloads on s3). Datasync is overkill and more effort than needed for a single copy. If you have zillions of tiny 1k files you may want to zip them up first.

How would I go about unzipping that zip in the S3? I have not heard of that before.

S3 is different than traditional storage, it doesn’t support edit or file.open. Only put, get, and delete. Once you get the zipped file into S3 you can download to an EC2 and unzip it, then put it all back to s3. It sounds like it would take longer (with more work) but if you have millions of tiny files it’ll be faster due to the way TCP works.

Yeah, you can’t unzip within S3. The advice to zip doesn’t make sense for your use case.

You should hire someone to assist you because sounds like you don’t really know what you’re doing and you’re going to end up making mistakes.

Use updraft plugin to backup to s3. Restore from new EC2 instance by connecting to the same s3 bucket.

I mean, you could use a snowball, but it seems like overkill here.

I’d test again out of hours to see what’s throttling your connection.

If the upload speed is capped at network which you local computer is using, then you probably can try uploading directly from the server. Also definitely try using multiple servers/Computers (that are not sharing the same bandwidth). Also check out S3 accelerated endpoint. Lastly, try if you can get any luck by uploading to an EC2 first, and then transferring your data from EC2 to S3 in the same region should be stupidly fast.

This npm nodejs package/tool works really good and fast for uploading lot of small files from a given folder comparing to other tools that uploading one by one: https://www.npmjs.com/package/s3-batch-upload
i guess it is because it can run like 200 files upload simultaneously, anyway using this one for a few months and really pleased

No. The AWS CLI can be run on whatever machine you wish. If you habe the files locally on your own computer, you can install the CLI there. And remove it, if you want, when you’re done using it.

What tool were you using for uploads from your local computer when you got the terrible upload rates?