Media Library Folders Pro S3 & Spaces Quick Start Guide Old



Getting Started

These are the steps to follow in setting up your S3 bucket and activate the Media Library Folders Pro S3 license key.

1. Before configuring Media Library Folders Pro S3 & Spaces please backup you database and your uploads folder.

2. Make sure that any folders added to your media library by plugins are denoted as hidden folders (right click on each of these folders an select ‘Hide this folder’) to insure that its subfolders and files will not be transferred to S3.

3. For AWS S3 Create a new IAM User on AWS or for DigitalOcean Spaces users skip to 3b. 

3a. For AWS S3

Create a new IAM User on AWS or Log into your AWS Console and select IAM. Enter a user name. Under access type select ‘Programmatic Access’. Click ‘Next: Permissions’ and at the bottom of the page click ‘Next: Review’. Click ‘Create user’ which will generate the user security credentials, Access Key ID and a Secret Access Key which must be copied and stored in a safe place.

Add these keys to your wp-config.php file before the line that says:

/* That’s all, stop editing! Happy blogging. */

Enter the keys like this:

define(‘MF_AWS_ACCESS_KEY_ID’, ‘Your Access Key ID’);
define( ‘MF_AWS_SECRET_ACCESS_KEY’, ‘Your Secret Access Key’);

Now click the Close button. Now we will need to add permissons. Click the new user you just created. On the Summary page, click the Add Permissions button in the Permisions tab.

Under Grant Permissions, click Attach existing policies directly. Click the Create Policy button which will open a new browser tab and then select the JSON tab on the page.

Copy the text below and paste in it place of the current text in the JSON tab.

“Version”: “2012-10-17”,
“Statement”: [
“Effect”: “Allow”,
“Action”: [
“Resource”: [

Next, on the Review policy page, enter a name and a description of the policy. There should be no spaces in the policy name. Then click the create policy button.

On the next page, you will attach the policy you just created. Type all or part of the policy name in the search box. Select your policy by clicking the radio button next to it and under Policy Actions, select Attach.

Before leaving the AWS Console you can go into S3 and create a bucket for your WordPress media library. Give it public access permission.

3b. For DigitalOcean Spaces

Create a new space and choose a region. Then go to Applications & API and generate the Access Key ID and a Secret Access Key which must be copied and stored in a safe place.

Add these keys to your wp-config.php file before the line that says:

define(‘MF_AWS_ACCESS_KEY_ID’, ‘Your Access Key ID’);
define( ‘MF_AWS_SECRET_ACCESS_KEY’, ‘Your Secret Access Key’);

And you will need to define your endpoint, if you are not using the default endpoint of ‘’ like so:

Also add this line to your wp-config.php to tell Media Library Folders Pro to connect to Spaces:

define(‘MF_CLOUD_TYPE’, ‘do’);

4. Once your new bucket or space has been created, open it and create a folder with the name wp-content.

5. Activate Media Library Folders Pro S3 & Spaces and go to S3 & Spaces Setup.

Enter your license key and click the ‘Save Changes’ button. Then click the ‘Activate License’ button.

6. Select a Bucket. Setup, click the ‘Select Image Bucket’ button. Choose one of the existing buckets, the region that you would like to use and click the ‘Save Bucket Selection’ button. Once the page refreshes you should be connected to your image bucket.

7. To move your files to your bucket, click the ‘Use files on the cloud server’ checkbox and then click ‘Copy Media Library to the cloud server’. However, if you plan to setup a CDN (Content Delivery Network) for your images, do not check the ‘Use files on the cloud server’ option and click ‘Copy Media Library to the cloud server’ to copy your media library to S3 or Spaces. A bulk copy operation will begin. Once completed a process will run to update the file locations in the database. Should the process end without showing the completing message, you can manually restart the process by click the Update File Locations button.

Once the media library files have been copied to the cloud server, if you are not creating a CDN, you have the option of removing the files from your local server by click the ‘Remove files from local server’ checkbox. This will initiate a process that will remove your media library files.

You can restore all your media file to your local server by clicking the ‘Download files from the cloud server’ button and you can remove your files by clicking the ‘Remove files from the cloud server’ button.

Setting Up A Multi Site

To setup a multi site, start with the main site/blog and follow the above instructions for setup MLFP on Spaces or S3.

Note when files are copied from the main site in the multi site to S3, all media library files for the entire multi site will be uploaded, but only the files in the main blog will have their locations updated. To configure each site of the multi site to use the files that have been copied to the cloud server it will be necessary to visit the Media Library Folders Pro S3 & Spaces Setup page on each site, enter, save and activate the license key, click the ‘Update File Locations’ button and wait for the site’s media library file locations to be updated with their cloud server locations.

There are also two settings that can be used for individual sites in a multisite:

1. Remove files from local server – If you want to remove the copies of files on your local server check this box and after confirmation, your files will be removed.

2. Remove individual downloaded files from the cloud server – Used this option if you want download files to be removed from the server.

Bulk down of files from S3 or Spaces can only be handled on a site wide basis and is done from the S3 & Spaces Setup page on the main site. When removing all files from th cloud server, visit each site and click the Remove Files from S3 button.

Media Library Folders Pro S3 Cloud Sync

Cloud Synchronization is a method for updating your site’s media library from an S3 bucket. It is not required to set up if you do not plan to upload files directly to your S3 bucket. To add files from your S3 bucket to your media library, you can setup and use this method. Note that the files need to be stored under the wp-content/uploads folder on your bucket.

To activate the Cloud Sync feature, add this define to your wp-config.php file:define(‘MLFP_CLOUD_SYNC’, true);Then if Media Library Folders Pro S3 is already activated on your site, deactivate and reactivate to add the mlfp_files_to_sync and the mlfp_s3_update_log tables to the database.To begin a cloud sync, if you are not already making regular backups of your site, you should make a backup copy of your WordPress database. Then go to the Cloud Sync page. When the page is loading, it will be collecting the location of all the files on the bucket and placing them in a table in the database. This make take several minutes.

Once the page finishes loading you will see the word “Ready” display the first row of buttons.

Click the Begin Cloud Sync button to start the process and leave the browser tab open when the syncing is in progress.

With the buttons provided in the Sync Entire Bucket section you are able to pause the sync process using the Stop Sync button, resume syncing, log a problem file and continue syncing and view the sync log of problem files.

When syncing is paused, it is possible to leave the page and later return and press the Resume Sync to continue the previous syncing session. But if the Begin Sync button is click, syncing will start over from the beginning.

If one wants to sync the contents of a single folder, the Sync Selected Folder section of the page allows you to select a particular folder an process the files and folders it contains. The progress of the select folder sync is display in the same area of the page as the entire bucket sync and problem files logged during the sync can viewed using the View Sync Log button in the Sync Entire Bucket section of the page.

If you encounter errors while running the cloud sync, turn on WordPress debugging and rerunning the sync process to determining the cause of the issue. To turn on WordPress debugging, edit the wp-config.php file and change

define(‘WP_DEBUG’, false);
define(‘WP_DEBUG’, true); define(‘WP_DEBUG_LOG’, true); define(‘WP_DEBUG_DISPLAY’, false); @ini_set(‘display_errors’, 0);

(Be sure to change this back when you are done.)

This configuration will write warnings, notices and errors to a debug.log file in the wp- content folder. Not all of these message will be related to Media Library Folders Pro.

AWS Object Versioning Support

Do you often update or replace files and images on your AWS S3 bucket linked media library? Do you find it useful to keep copies of your previous files? Well, this release now enables MLFP to work with the object versioning feature of Amazon Web Services to accomplish this seamlessly.

If Media Library Folders Pro is used to replace the file function, S3 will save the previous version of the file which is necessary to retrieve the earlier version, which can be done via the AWS S3 console. Simply view the folder and turn on the “Show Versions” option to view all the previous versions of the files in the folder:

See for more information.

Object Versioning can be turned on in a bucket’s property’s tab: