WP Offload S3
migrate existing wp-content dir to s3? (4 posts)

  1. Wykydtron
    Posted 1 year 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?


  2. mandymck
    Posted 1 year 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
    Posted 1 year ago #

    chaos1, did you ever find an answer?


  4. danatfandor
    Posted 1 year 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?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Offload S3
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic