Skip to content

Installation

Thai Phan edited this page Mar 30, 2018 · 10 revisions

These are the recommended instructions on how to your Magento instance to sync images to S3 using my extension.

Note: Please make sure to back up your media files before you run these instructions! You never know what might happen!

Installation

You need to install this extension using either Composer or modman.

Composer (recommended)

Install and configure dependencies

If you choose to install this extension using Composer, you will might need to first install the Magento Composer Installer. You can skip this step if you already have the Magento Composer Installer installed.

composer require magento-hackathon/magento-composer-installer

You will be prompted to input the relative path to your Magento instance as part of this process.

Install the extension using Composer

Once you have installed the Magento Composer install, you can install the extension.

composer require thaiphan/magento-s3

modman

modman clone https://github.com/thaiphan/magento-s3

Configuration

Step 1: Configure Magento to use your S3 bucket

You need to run the s3_config.php shell script in order to register your S3 bucket with Magento.

cd /path/to/magento/shell

php s3_config.php \
    --access-key-id XXXXXXXX \
    --secret-key XXXXXXXX \
    --bucket XXXXXXXX \
    --region XXXXXXXX

Step 2: Upload all pre-existing images to your S3 bucket

You need to run the s3_export.php shell script in order to upload all your pre-existing uploaded images, e.g. category images, product images, etc., to S3. This might take a while.

cd /path/to/magento/shell

php s3_export.php

You can also perform a dry run if you want to preview the results of this operation.

php s3_export.php --dry-run

Step 3: Enable S3 integration for your Magento instance

Once you have successfully uploaded all your images to S3, you can turn on the extension. Enjoy!

cd /path/to/magento/shell

php s3_enable.php --yes