wp-sync v2.0.0-alpha.3
wpsync
A 'shell script' written in node.js for creating backups of, importing backups to, and syncing WordPress installations across local and remote hosts through ssh, sftp or ftp.
ALPHA Status
wp-sync
is licensed under a MIT license and comes with no warranty
whatsoever. It is also alpha software and will definitely contain lots
of bugs. It will probably wipe all your servers and databases. Use at
your own risk.
Dependencies
wpsync
expects you to have ssh
, scp
, lftp
, python
and cat
installed on your system and configured for the hosts you're going to
deal with.
Configuration
wpsync
needs a configuration file to work. You can specify the
location of a config file to use on the command line with the --config
option. Otherwise, wpsync
will look for wpsync.config.ini
in the
current working directory and all of its parent directories recursively.
If it doesn't find the file there, it will finally try to load it from
your ~/.wpsync
or ~/.config/wpsync
directory.
For all possible options, look at cli/wpsync.config.demo.ini
~/.wpsync / ~/.config/wpsync directory
You are required to have either of these, even if you don't keep a
global config file in there. wpsync
will use it to save backups and
cache information about hosts.
Installation
npm install -g wp-sync
, installs an executable called wps
. You can,
of course, also install it locally in a project and use it through npm
scripts or whatever.
Usage
Check wps --help
License and re-packaged code
wp-sync
re-packages some PHP and Python libraries for convenience.
lib/Mysqldump.php
Mysqldump.php by Michael J. Calkins and Diego Torres is published under the GNU General Public License.
lib/import-sql-database-mysql.php
import-sql-database-mysql.php by tazotodua does not seem to be distributed in terms of an open source license (and it should probably be replaced with something better. How does phpmyadmin import dumps?).
lib/srdb.class.php
srdb.class.php is taken from Search Replace DB, was written by David Coveney of Interconnect IT Ltd (UK) and is published in terms of the GPL v3
lib/python/packages
The python-future package is written by Ed Schofield of Python Charmers Pty Ltd, Australia and distributed under an MIT License. The License Text is:
Copyright (c) 2013-2016 Python Charmers Pty Ltd, Australia
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
The sqlparse module is written by Andi Albrecht and is published under the following terms:
Copyright (c) 2016, Andi Albrecht <albrecht.andi@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the authors nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The Requests library is written by Kenneth Reitz and published in terms of the Apache2 License.
wp-sync
The rest of the code in this repository (that is, the actual wp-sync
application) is licensed under a MIT License. You find the full license
text in LICENSE.md
.
TODO
- write tests ... 😓🔥
- make installation.name in config mandatory and check it for filename safety, make it an error if it isn't a valid filename
- if user works with local config files, there may be multiple installations w/ the same name. make sure that cached installationInfo doesn't collide in this case, e.g. distinguish it by the path of the config file's directory. (or maybe stop caching the info altogether, because there's currently no strategy to invalidate it)