{"id":14955183,"url":"https://github.com/logsmith/log-flume","last_synced_at":"2025-10-24T07:30:49.915Z","repository":{"id":62518741,"uuid":"85091371","full_name":"logsmith/log-flume","owner":"logsmith","description":"Sync media from WordPress to Amazon S3","archived":false,"fork":false,"pushed_at":"2018-05-27T15:57:26.000Z","size":103,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-29T08:41:35.775Z","etag":null,"topics":["aws-creds","s3","s3-bucket","sync","wordpress","wordpress-development","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/logsmith.png","metadata":{"files":{"readme":"Readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-15T15:46:12.000Z","updated_at":"2021-01-12T13:02:29.000Z","dependencies_parsed_at":"2022-11-02T13:17:55.700Z","dependency_job_id":null,"html_url":"https://github.com/logsmith/log-flume","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logsmith%2Flog-flume","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logsmith%2Flog-flume/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logsmith%2Flog-flume/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logsmith%2Flog-flume/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logsmith","download_url":"https://codeload.github.com/logsmith/log-flume/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237932068,"owners_count":19389560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-creds","s3","s3-bucket","sync","wordpress","wordpress-development","wordpress-plugin"],"created_at":"2024-09-24T13:10:37.589Z","updated_at":"2025-10-24T07:30:49.579Z","avatar_url":"https://github.com/logsmith.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![log-flume-logo](https://cloud.githubusercontent.com/assets/1636310/24171665/407f51a2-0e7d-11e7-974f-f80e0c45e1ed.jpg)\n\nThis allows developers to sync WordPress media libraries between machines over Amazon S3.\n\nIt can also be used for backing up websites or even moving websites between servers\n\n### How Log Flume talks to S3\n\nThe setup will ask you to add these constants to your wp-config.php file:\n\n- LOG_FLUME_REGION\n- LOG_FLUME_ACCESS_KEY_ID\n- LOG_FLUME_SECRET_ACCESS_KEY\n\nYou can obtain these details by creating an IAM user. Here is [our guide](https://github.com/logsmith/log-flume/wiki/Getting-AWS-credentials) on how to setup an IAM Amazon user and get the access and secret key that you need.\n\n## Installation\n\n#### 1. Add the Wordpress plugin to your composer file by navigating to your project and running this inside a terminal:\n\n```\ncomposer require logsmith/log-flume\n```\n\n#### 2. Activate the plugin via the admin interface, or just run:\n\n```\nwp plugin activate log-flume\n```\n\n#### 3. Add your credentials to your wp-config file.\n\nAnd these constants to your wp-config file:\n\n```\ndefine('LOG_FLUME_REGION','eu-west-2'); //London\ndefine('LOG_FLUME_ACCESS_KEY_ID','');\ndefine('LOG_FLUME_SECRET_ACCESS_KEY','');\n```\n\n#### 4. Then finally run (you will need the constants above):\n\n```\nwp logflume check_credentials\n```\n\n#### 5. If the check is successful, you can start the log flume setup:\n\n```\nwp logflume create_bucket \u003cbucket_name\u003e\n```\n\n`bucket_name` is usually the address of the site you are currently working on ('website.local')\n\nYou will also be asked `Create bucket? [y/n]` - supply 'y' if this is a fresh setup. Select N to not do that.\n\n#### 6. Time to sync!\n\n```\nwp logflume sync\n```\n\nBucket name is usually the address of the site you are currently using\n\n## Using log-flume to backup a live website\n\nLog-flume can be used to backup a live site as well as sync development assets.\n\n#### 1. Install and setup log-flume\n\nGet log-flume running on local version of the site (using the 'Installation' guide above).\n\n#### 2. Log into the live env\n\nSSH into the live environment and navigate to your WordPress installation.\n\n#### 3. Check local credential work in live env\n\n```\nwp logflume check_credentials\n```\n\nRun to find any issues.\n\n#### 4. Setup a bucket for the live env\n\nIt's always good to separate the dev and live environments.\n\n```\nwp logflume create_bucket \u003cbucket_name\u003e\n```\n\nCreate a fresh bucket with the live URL as the bucket name. For example:\n\n```\nwp logflume create_bucket atomicsmash.co.uk\n```\n\n#### 5. Setup auto-deletion of SQL files\n\nDepending on how often you run this command, the SQL files will start to build up quickly. You can setup an S3 folder lifecycle to auto-delete files older than X number of days.\n\n```\nwp logflume autodelete_sql \u003cnumber_of_days\u003e\n```\n\nWe usually usually retain backups for 30 days:\n\n```\nwp logflume autodelete_sql 30\n```\n\n#### 6. Setting up auto-backup (cron job)\n\nTo get the backup command to run on a regular basis, you need to setup a cron job. Use something similar to this:\n\n```\n/usr/local/bin/wp logflume backup_wordpress --path=/path/to/www.website.co.uk/\n```\n\nIf you are using composer in your project then your WordPress core files might be inside a subfolder, please modify the path to reflect this. If WordPress lives inside \"/wp/\" then the cron job would look like this:\n\n```\n/usr/local/bin/wp logflume backup_wordpress --path=/path/to/www.website.co.uk/wp\n```\n\nIf you are using forge, then simply add to the server scheduling panel:\n\n![forge-schedule](https://user-images.githubusercontent.com/1636310/40587898-73fcbca0-61cd-11e8-8317-f1d24645bee5.png)\n\n\n## Functions\n\n**logflume sync [--direction=\u003cup-or-down\u003e]**\n\u003e This function runs `sync` **and** a DB backup.\n\n**logflume backup_wordpress**\n\u003e This function runs `sync` **and** a DB backup.\n\n**logflume create_bucket \u003cbucket_name\u003e**\n\u003e Created the required bucket and bucket settings for handling media on S3. It's good to use the current hostname.\n\n**logflume select_bucket \u003cbucket_name\u003e**\n\u003e Use this to change the bucket that log-flume is currently sync to.\n\n**logflume check_credentials**\n\u003e Performs a simple S3 function to make sure it can access the selected bucket\n\n**logflume autodelete_sql**\n\u003e Setup a S3 lifecycle to auto-delete from the SQL folder after a number of days.\n\n\n## Troubleshooting\n\nAre you receiving an error similar to `PHP Fatal error:  Uncaught Error: Class 'Aws\\S3\\S3Client' not found in /path/to/file`\n\nMake sure you are requiring your autoload.php generated by composer. We usually add this to the top of our wp-config file:\n\n```\nrequire( dirname( __FILE__ ) . '/vendor/autoload.php' );\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogsmith%2Flog-flume","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogsmith%2Flog-flume","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogsmith%2Flog-flume/lists"}