10up / wpsnapshots

(DEPRECATED) A project sharing tool for WordPress.
MIT License
215 stars 22 forks source link

(DEPRECATED) WP Snapshots

THIS PROJECT IS DEPREACTED IN FAVOR OF THE NEW SNAPSHOTS BUILT AS A WP CLI COMMAND.

A project sharing tool for WordPress.

Support Level Release Version MIT License

Table of Contents

Overview

WP Snapshots is a project sharing tool for WordPress. Operated via the command line, this tool empowers developers to easily push snapshots of projects into the cloud for sharing with team members. Team members can pull snapshots, either creating new WordPress development environments or into existing installs such that everything "just works". No more downloading files, matching WordPress versions, SQL dumps, fixing table prefixes, running search/replace commands, etc. WP Snapshots even works with multisite.

WP Snapshots stores snapshots in a centralized repository (AWS). Users setup up WP Snapshots with their team's AWS credentials. Users can then push, pull, and search for snapshots. When a user pushes a snapshot, an instance of their current environment (wp-content/, database, etc.) is pushed to Amazon and associated with a particular project slug. When a snapshot is pulled, files are pulled from the cloud either by creating a new WordPress install with the pulled database or by replacing wp-content/ and intelligently merging the database. WP Snapshots will ensure your local version of WordPress matches the snapshot..

A snapshot can contain files, the database, or both. Snapshot files (wp-content/) and WordPress database tables are stored in Amazon S3. General snapshot meta data is stored in Amazon DynamoDB.

Upgrade

WP Snapshots 2.0+ allows users to store database and files independently. As such, some snapshots may only have files or vice-versa. Therefore, WP Snapshots pre 2.0 will break when attempting to pull a 2.0+ snapshot that contains only files or database. WP Snapshots 2.0 works perfectly with older snapshots. If you are running an older version of WP Snapshots, you should upgrade immediately.

Install

WP Snapshots is easiest to use as a global Composer package. It's highly recommended you run WP Snapshots from WITHIN your dev environment (inside VM or container). Assuming you have Composer/MySQL installed and SSH keys setup within GitHub/10up organiziation, do the following:

Install WP Snapshots as a global Composer package via Packagist:

  composer global require 10up/wpsnapshots

If global Composer scripts are not in your path, add them:

export PATH=~/.composer/vendor/bin:$PATH

If you are using VVV, add global Composer scripts to your path with this command:

export PATH=~/.config/composer/vendor/bin:$PATH

Configure

WP Snapshots currently relies on AWS to store files and data. As such, you need to connect to a "repository" hosted on AWS. We have compiled instructions on how to setup a repository on AWS.

If WP Snapshots has not been setup for your team/company, you'll need to create the WP Snapshots repository:

wpsnapshots create-repository <repository>

If a repository has already been created, this command will do nothing.

Usage

WP Snapshots revolves around pushing, pulling, and searching for snapshots. WP Snapshots can push any setup WordPress install. WP Snapshots can pull any snapshot regardless of whether WordPress is setup or not. If WordPress is not setup during a pull, WP Snapshots will guide you through setting it up.

Documentation for each operation is as follows:

Identity Access Management and Security

Snapshots is intended to store development environments. It was not meant to be a secure solution to store sensitive production data in the cloud.

Snapshots relies on AWS for access management. Each snapshot is associated with a project slug. Using AWS IAM, specific users can be restricted to specific projects. It is your responsibility to ensure your AWS cloud environment is properly secured.

PII

Snapshots automatically scrubs user information when creating a snapshot. Scrubbed data only includes standard WordPress data e.g. user name, passwords, some user meta, etc. Certain plugins or custom code my store PII elsewhere. It is strongly recommended you review your project for PII (personal identifable information) before pushing snapshots to AWS.

Troubleshooting

Windows

WP Snapshots has been used successfully inside Windows Subsystem for Linux.

Support Level

Active: 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.

Like what you see?

Work with us at 10up