Wordmove is a nice little gem that lets you automatically mirror local Wordpress installations and DB data back and forth from your local development machine to the remote staging server. SSH and FTP connections are both supported.
Think of it like Capistrano for Wordpress, complete with push/pull capabilities.
- Push all WordPress, including database and uploads: http://vimeo.com/74648079
- Pull database and uploads, adapting paths and urls: http://vimeo.com/74646861
- Push only theme, transfer only modified files: http://vimeo.com/74647529
That's easy:
gem install wordmove
Beware!
From version 1.0 we have decided to change wordmove flags' behaviour: they used to tell wordmove which options to skip, now they tell instead which options to include. In the Movefile, we have also changed all "username" fields to be just "user".
So please, be very careful when upgrading ❤️
> wordmove help
Tasks:
wordmove help [TASK] # Describe available tasks or one specific task
wordmove init # Generates a brand new Movefile
wordmove pull # Pulls WP data from remote host to the local machine
wordmove push # Pushes WP data from local machine to remote host
You can configure Wordmove creating a Movefile
. That's just a YAML file with all the local and remote host infos:
local:
vhost: "http://vhost.local"
wordpress_path: "/home/john/sites/your_site" # use an absolute path here
database:
name: "database_name"
user: "user"
password: "password"
host: "127.0.0.1"
production:
vhost: "http://example.com"
wordpress_path: "/var/www/your_site" # use an absolute path here
database:
name: "database_name"
user: "user"
password: "password"
host: "host"
# port: "3308" # Use just in case you have exotic server config
exclude:
- ".git/"
- ".gitignore"
- ".sass-cache/"
- "bin/"
- "tmp/*"
- "Gemfile*"
- "Movefile"
- "wp-config.php"
- "wp-content/*.sql"
# paths: # you can customize wordpress internal paths
# wp_content: "wp-content"
# uploads: "wp-content/uploads"
# plugins: "wp-content/plugins"
# themes: "wp-content/themes"
# languages: "wp-content/languages"
# themes: "wp-content/themes"
# ssh:
# host: "host"
# user: "user"
# password: "password" # password is optional, will use public keys if available.
# port: 22 # Port is optional
# rsync_options: "--verbose" # Additional rsync options, optional
# gateway: # Gateway is optional
# host: "host"
# user: "user"
# password: "password" # password is optional, will use public keys if available.
# ftp:
# user: "user"
# password: "password"
# host: "host"
# passive: true
# scheme: "ftps" # default "ftp"
# staging: # multiple environments can be specified
# [...]
In order for wordmove to work with SSH, you need to install rsync
on your
machine.
Just delete the remote.ssh.password
field in your Movefile
. Easy peasy.
Please take a look at the various gotchas of the underlying photocopier
gem.
In order for wordmove to work with FTP, you need to install lftp
on your
machine. Then in the remote host section in your Movefile:
- Use the relative FTP path as
wordpress_path
- Use the absolute FTP path as
wordpress_absolute_path
(you may need to recover this from the__FILE__
constant)
Add to the YAML config a passive
flag set to true
.
If server's certificate is not signed by a known Certificate Authority, you can disable lftp
check by adding
set ssl:verify-certificate no
to your ~/.lftprc
or ~/.lftp/rc
If host name used to connect to the server does not corresponds to the host name in its certificate, you can disable
lftp
check by adding set ssl:check-hostname no
to your ~/.lftprc
or ~/.lftp/rc
More lftp
configuration flags here.
We're glad you asked! We basically upload via FTP a PHP script that performs the various
import/export operations. This script then gets executed via HTTP. Don't worry
too much about security though: the script is deleted just after the usage,
and can only be executed by wordmove
, as each time it requires a pre-shared
one-time-password to be run.
You can define multiple environments in your Movefile
, such as production, staging, etc.
Use -e
with pull
or push
to run the command on the specified environment.
For example:
wordmove push -e staging -d
will push your local database to the staging environment only
Visit Wordpress Tools.
- The dump script is the
MYSQL-dump
PHP package by David Grudl; - The import script used is the BigDump library;
In order to promote a simpler contribution workflow we have decided to fork the master
branch and PR to the master
branch
.
We will accordingly tag and release or pre-release versions to the rubygems.org repository.
Do not consider the dev
branch for your forks and PR.
We will never more use version-named branches as in the past.
Feel free to open an issue about contribution if more you need more info
(The MIT License)
Copyright © 2013-2015 weLaika
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.