Command line scripts for syncing Wordpress site assets and databases between local development environments to/from (or between) test/stage/live environments with Terminal Tools
- Terminal Tools && server sync core
- We're expecting you're using envWP for managing your environments - it might work without it though - let us know :)
This is an example of how ttools
can be used to keep your local repo in sync with a dev server.
Start by setting up the sub modules:
git submodule add git://github.com/titledk/ttools-core.git
git submodule add git://github.com/titledk/ttools-githelpers.git #is not absolutely necessary, but you'll want it for deployment
git submodule add git://github.com/titledk/ttools-sitesync-core.git
git submodule add git://github.com/CPHCloud/ttools-sitesync-wordpress.git
Add something along the following lines to your ttools-config.yml
:
Menu:
Heading1:
Title: Local
Item1:
Title: Overwrite Local Site with Database & Assets from Dev Site
Command: "ttools-sitesync-wordpress/local/overwrite-current-with-remote.sh"
ServerSync:
FrameworkModule: 'ttools-sitesync-wordpress'
That's it. In order for this to work, you'll need to have a Dev
environment set up - see
https://github.com/titledk/ttools-core#configuration-example for info on how to do that.
See http://wp-cli.org. The entire wp-cli.phar
has been added to
the repository to make deployments as little painful as possible.
cd thirdparty
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
As Wordpress is hard coding lots of stuff, you can also use this module to help you fix stuff manually:
ttools/sitesync-wordpress/lib/replace-base-url-on-current-site.sh URL_TO_REPLACE_INCL_HTTP
Check you error reporting settings in php.ini
:
php -i | grep "errors\|ini"
then uncomment it, or add the following to env-config.php
, if you're using such: error_reporting(0);