Amazon S3 bucket migration

Any issue about installation and configuration of the Cyclos 4 version

Moderators: hugo, alexandre, rmvanarkel

Post Reply
jar
Posts: 121
Joined: Mon Apr 20, 2015 8:55 am

Amazon S3 bucket migration

Post by jar »

Hi,

We use amazon S3 to store all documents and images used by Cyclos.
First, we used one bucket to store all images in one region. Then, we decided to create another bucket in another region and setup cyclos to use this new bucket for all images. We had no problem with this configuration. Works fine. But it only stores the new images in the new bucket.
We want to copy images from the first bucket to the second one and change the links of images from the first bucket to the new bucket. Is this possible? If yes, how can we do it?
Thanks for your kind attention.
Best regards,

JAR
andres
Posts: 5
Joined: Fri Dec 16, 2011 9:31 am
Location: Montevideo, Uruguay

Re: Amazon S3 bucket migration

Post by andres »

Hi,

You should first move/copy the files to the new bucket (without changing the file names) using the AWS console.

Later, you need to update the stored_files table to point to the new bucket. Suppose the old bucket name is: old_bucket and the new one is new_bucket, then you can run the following SQL statement:

Code: Select all

UPDATE stored_files SET metadata = replace(metadata, 'old_bucket/', 'new_bucket/') 
WHERE position('old_bucket/' in metadata) > 0;
Regards.
Andrés Meyer
Cyclos development team
jar
Posts: 121
Joined: Mon Apr 20, 2015 8:55 am

Re: Amazon S3 bucket migration

Post by jar »

Thanks!
Thanks for your kind attention.
Best regards,

JAR
Post Reply