Migrate LargeFS to a New Region
When WP Engine initially rolled out the LargeFS media offload to Amazon S3 feature all buckets were set up in the us-east-1 region. As more regions have become available you may find yourself wanting to migrate your images to a region closer geographically to where your website is hosted now, like London.
Please be aware that different regions have different pricing associated with storage and data transfer, or bandwidth. For the current list of prices in each region check out AWS’s S3 Pricing page.
Create New Bucket
First, you’ll need to create your new bucket in the region that you’d like via the AWS Console following the Setup Guide on WP Engine. Once your bucket is created, you’ve enabled static website hosting, and configured your bucket policy, download the LargeFS validation file (ends with .largefs) found in the root of your old bucket and upload it into the new bucket with Public-Read permissions.
This validation file will be used by WP Engine Support to confirm your bucket is configured properly.
Create IAM User for S3
Now that the new bucket is created, we’ll need to create an IAM User for Cyberduck to be able to connect to your S3 account and manipulate your buckets and objects within. Under Services in the AWS Console, in the Security, Identity, and Compliance section navigate to IAM.
Once on the IAM page, select Users and then the blue Add User button. For Username you can choose whatever name you would like to use with Cyberduck (e.g. S3Admin, largefsmigration, etc). Ensure that you check the box labeled Programmatic Access to be able to generate the proper keys to connect to your S3 buckets.
Move on to the Permissions page. Here, you’ll select the box for Attach existing policies directly, and filter for AmazonS3FullAccess. Check the box next to the AmazonS3FullAccess option and move on to the next page.
This next step is important, as you’ll be given your Access and Secret keys. Once you’ve ensured everything looks good go ahead and click Create User. On this next page, we recommend downloading the CSV file that stores your credentials and keep it in a safe spot. You can also just copy and paste the keys displayed on the screen.
Duplicate Content
Now that the setup part is all taken care of, you will need to copy the content from your old bucket to the new one. In this guide we will explain how to perform these steps with Cyberduck, but you can also use Transmit if you use Mac OS X.
If you do not currently have Cyberduck, you can download it for free from the Cyberduck Website. Once you have installed opened Cyberduck, click Open Connection and choose S3 from the top dropdown menu. Enter your Access and Secret Keys into the appropriate fields then click Connect.
Once connected you’ll be presented with a list of your accounts S3 buckets. Due to how S3 operates, you’ll need to first duplicate the content within your bucket so that we can move it into the new bucket. Right-click the folder with your WP Engine environment name, and choose Duplicate. You can leave the new name as is, as we’ll be changing it back once it’s been moved over to the new bucket. Depending on the total size of your objects this may take a few minutes.
Now drag the new folder into the new bucket. This step may also take a bit depending on the total size of the objects.
Make New Bucket Public
Once everything has been copied over, you will need to make all these new objects publicly accessible so your website can serve these images. This is done automatically by WP Engine when uploading files to your S3 bucket, but since we made a copy we need to perform this step using Cyberduck.
Right-click the new folder that you brought into the new bucket and choose Info and click on the Permissions tab. Click the gear icon and choose Everyone. Then, next to Everyone, choose Read.
A pop up regarding applying the policy recursively to your folder will appear. Check the option for Always (so you don’t have to click yes for every subfolder within your bucket).
Now, you will need to rename the new folder in your new bucket. This will ensure your bucket transition is seamless. Right-click the folder name, choose Rename, and set it to your WP Engine environment name as it was on the old bucket.
Once this has completed, contact WP Engine Support so that we can change the bucket name and add your bucket region. Support is available 24/7 via Live Chat in your User Portal. If everything was performed properly you should be able to see all of your images on your site once this change has been made. Should you see broken images, ask WP Engine Support put your old bucket back in place while you review the steps in this article.
Once you verify everything looks good, you can delete the objects from your old bucket to avoid paying double storage fees. We recommend taking this chance to create an archive within Cyberduck, and download it to your local machine as a backup of your website’s content.
NEXT STEP: Learn how to copy media between S3 buckets