cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make Hybris generate sys_master folder in Amazon S3 bucket instead of sys-master?

geffchang
Active Contributor

We are planning to migrate our Hybris 5.7 instance from on-premise servers to AWS servers.

One thing we noticed is that the data folder in on-premise is "sys_master" (with an underscore), while the data folder in AWS S3 bucket is "sys-master" (with a dash). So, the media data / images (that we migrate from on-premise to S3) (as well as the database, which we are also migrating to Amazon RDS) cannot be displayed correctly in AWS, because it's not able to resolve the path.

How do we fix this issue? Is it possible for Amazon S3 bucket to use sys_master, instead of sys-master?

Accepted Solutions (1)

Accepted Solutions (1)

geffchang
Active Contributor
0 Kudos

We couldn't find a solution using source code or configuration. However, we had a workaround, which I described here: https://answers.sap.com/answers/12804351/view.html

Answers (2)

Answers (2)

matthewsmith
Participant
0 Kudos

The "sys-master" path element is added in the S3MediaStorageStrategy.setTenantPrefix() method:

public void setTenantPrefix() {
    this.tenantPrefix = "sys-" + Registry.getCurrentTenantNoFallback().getTenantID().toLowerCase();
}

Therefore, to override this, you can create a new media storage strategy that inherits from S3MediaStorageStrategy, and then override the setTenantPrefix() method so that it uses "sys_" rather than "sys-".

Beware: some of the other S3 classes use the same logic to construct a tenant prefix so you will also need to replace them: S3MediaStorageCleaner is the one I know about, you may want to look through the other classes in the extension to check.

krishnash
Explorer
0 Kudos

Hi Geff, Please let us if your issue is solved. We are facing same issues.

Thanks, Krishna