WordPress.org

Ready to get started?Download WordPress

Forums

Amazon S3 and Cloudfront
migrate existing wp-content dir to s3? (4 posts)

  1. chaos1
    Member
    Posted 4 months ago #

    I am unable to find information, but has anyone written out a document of migrating the entire wp-content directory onto S3 and attaching it to say, EB?

    https://wordpress.org/plugins/amazon-s3-and-cloudfront/

  2. mandymck
    Member
    Posted 4 months ago #

    Hey Chaos, I am using a git repo hosted on S3 tied to EB for my WP site. The theory is you then have a stateless version of WP that is easily load balanced. I am still building out so have not tested, but if you're interested below is the link that I followed. I didn't find it as easy as just following his steps, but after a fair amount of mucking around I got it working. The second link is setting up a local server which is the first step in case you need it.



  3. danatfandor
    Member
    Posted 4 months ago #

    chaos1, did you ever find an answer?

    --dan

  4. danatfandor
    Member
    Posted 4 months ago #

    Although I haven't tried it, by examining the code it looks like the steps are:

    1. upload all wp-content/upload directory to s3
    2. modify wordpress database such that:
    1. for each attachment (wp_posts that has a post_type of "attachment"
      • grab the guid as old_guid
      • create the s3_new_guid as to be where the old_guid gets copied to on s3
      • create the cf_or_s3_guid to be the guid that should appear in the post
      • find the old_guid in the parent post and replace with cf_or_s3_guid
      • modify wp_posts guid to be s3_new_guid
      • create a wp_postmeta with:
      • post_id to the id in wp_posts
      • meta_key to "amazonS3_info"
      • meta_value to a:2:{s:6:"bucket";s:BUCKET-NAME_LENGTH:BUCKET-NAME;s:3:"key";sKEY-LENGTH:KEY;}

    that seems like it should do the trick. I'll let you know when I try it?

Reply

You must log in to post.

About this Plugin

About this Topic

Tags