The information in this guide was compiled during the contentstore migration from EBS to S3 for one of our large AWS Alfresco users.
There are a variety of reasons to migrate the contentstore to S3. The main one is to increase the resilience of the store - during most of the AWS outages it has been EBS that has been most affected, including data loss (search google for 'ebs data loss').
With S3's 'Designed for 99.999999999% durability and 99.99% availability of objects over a given year' sla, and 'Amazon S3 Server Side Encryption (SSE)' , putting your content on S3 means you will have secure and available content items at all times.
Set up S3
First of all, create a new S3 bucket for you to use.
Make a note of the Bucket name. This will be used in all places tagged <s3_bucket>.
It is also a good idea to secure the bucket more than the default, using IAM - see the AWS documentation for this.
Next, install a tool that will allow you to migrate your existing content to S3, such as the S3tools.
If you are using RHEL6, the instructions are (for other operating systems follow the instructions on the s3tools website):
If your contentstore is not massive and you have space on your ephemeral disks, you can copy your contentstore to 'cachedcontent' - this will mean that the S3 cached content is pre-populated. It is much better to have this on the local ephemeral disk than on EBS.
If you are using lucene, set the following if it is not already set:
Make sure that Alfresco is stopped before you progress any further.
Once your content is all in S3, and your Alfresco properties are all configured to use S3 as the contentstore location, there is one final step that is needed to be performed - update the Database!
One of the tables Alfresco uses in the Database has a property that links an item of content to its location. Since we have moved the content to S3, we need to update all these links in the DB. Luckily it's easy
First, get the details of you database configuration from 'alfresco-global.properties'.
If the mysql tools are not already installed on your box, install them, e.g.
yum install mysql
Run Mysqldump, connecting to your DB, and dump the table called 'alf_content_url'.
The command below does this (you will be prompted for your user's pwd):