{"id":13631738,"url":"https://github.com/welaika/wordmove","last_synced_at":"2025-04-11T01:43:20.014Z","repository":{"id":1953427,"uuid":"2883533","full_name":"welaika/wordmove","owner":"welaika","description":"Multi-stage command line deploy/mirroring and task runner for Wordpress","archived":false,"fork":false,"pushed_at":"2022-10-18T21:14:25.000Z","size":958,"stargazers_count":1869,"open_issues_count":23,"forks_count":173,"subscribers_count":52,"default_branch":"master","last_synced_at":"2025-04-03T17:07:51.071Z","etag":null,"topics":["automation","deploy","docker","docker-image","ftp","gem","multistage","ruby","ssh","task-runner","wordpress","wpcli"],"latest_commit_sha":null,"homepage":"https://wptools.it/wordmove","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/welaika.png","metadata":{"files":{"readme":"README.mdown","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-11-30T14:07:56.000Z","updated_at":"2025-04-02T14:26:40.000Z","dependencies_parsed_at":"2022-08-20T17:40:27.744Z","dependency_job_id":null,"html_url":"https://github.com/welaika/wordmove","commit_stats":null,"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/welaika%2Fwordmove","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/welaika%2Fwordmove/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/welaika%2Fwordmove/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/welaika%2Fwordmove/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/welaika","download_url":"https://codeload.github.com/welaika/wordmove/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248327715,"owners_count":21085257,"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":["automation","deploy","docker","docker-image","ftp","gem","multistage","ruby","ssh","task-runner","wordpress","wpcli"],"created_at":"2024-08-01T22:02:36.355Z","updated_at":"2025-04-11T01:43:19.992Z","avatar_url":"https://github.com/welaika.png","language":"Ruby","funding_links":[],"categories":["Ruby","Happy Exploring 🤘","docker"],"sub_categories":[],"readme":"# Wordmove\n\n![logo](https://raw.githubusercontent.com/welaika/wordmove/master/assets/images/wordmove.png)\n\nWordmove is a command line tool that lets you automatically mirror local WordPress\ninstallations and DB data back and forth from your local development machine to\none or more remote servers.\n\nWordmove has also a neat [hook](https://github.com/welaika/wordmove/wiki/Hooks) system which enables you to run arbitrary commands\nbefore and after push/pull actions. Local and remote commands are both supported (remote\nones only on SSH protocol).\n\n[FTP support development has been discontinued](https://github.com/welaika/wordmove/wiki/FTP-support-disclaimer), thus not all features are granted when using this protocol.\n\n[![Tests](https://github.com/welaika/wordmove/workflows/Tests/badge.svg)](https://github.com/welaika/wordmove/actions)\n[![Slack channel](https://img.shields.io/badge/Slack-WP--Hub-blue.svg)](https://wphub-auto-invitation.herokuapp.com/)\n[![Gem Version](https://badge.fury.io/rb/wordmove.svg)](https://rubygems.org/gems/wordmove)\n[![Docker Build Status](https://img.shields.io/docker/automated/welaika/wordmove.svg)](https://hub.docker.com/r/welaika/wordmove/)\n\n\n## Installation\n\nWordmove is developed in ruby and packaged and distributed as a gem.\n\nTo install:\n\n    gem install wordmove\n\nAnd to update:\n\n    gem update wordmove\n\nYou can read more about ruby gems ecosystem on the official site https://rubygems.org/.\n\n## Peer dependencies\n\nWordmove acts as automation glue between tools you already have and love. These are its peer dependencies which **you need to have installed** and executable through your system $PATH:\n\n| Program   | Mandatory?                       |\n| --------- | -------------------------------- |\n| rsync     | Yes for SSH protocol             |\n| mysql     | Yes                              |\n| mysqldump | Yes                              |\n| wp-cli    | Yes by default, but configurable |\n| lftp      | Yes, for FTP protocol            |\n\nWordmove also expect that the remote server will have the following commands: `gzip`, `nice`, `mysql`, `rsync`. All of these should be always present by default on any WordPress hosting.\n\n## Usage\n\n```\n\u003e wordmove help\nCommands:\n  wordmove --version, -v    # Print the version\n  wordmove doctor           # Do some local configuration and environment checks\n  wordmove help [TASK]      # Describe available tasks or one specific task\n  wordmove init             # Generates a brand new movefile.yml\n  wordmove list             # List all environments and vhosts\n  wordmove pull             # Pulls WP data from remote host to the local machine\n  wordmove push             # Pushes WP data from local machine to remote host\n```\n\nMove inside the WordPress folder and use `wordmove init` to generate a new `movefile.yml` and edit it with your settings. Read the next paragraph for more info.\n\n**See the wiki article: [Usage and flags explained](https://github.com/welaika/wordmove/wiki/Usage-and-flags-explained) for more info.**\n\n\n\n### Multistage\n\nYou can define multiple remote environments in your `movefile.yml`, such as production, staging, etc. Every first level key in the YAML other than the defaults and mandatory `global` and `local` will be interpreted as a remote environment.\n\nUse `-e` with `pull` or `push` to run the command on the specified environment.\n\nFor example: `wordmove push -e staging -d` will push your local database to the staging environment.\n\nWe warmly **recommend to read the wiki article**: [Multiple environments explained](https://github.com/welaika/wordmove/wiki/Multiple-environments-explained)\n\n## movefile.yml\n\nYou can configure Wordmove creating a `movefile.yml`. That's a YAML file with local and remote host(s) infos:\n\n```yaml\nglobal:\n  sql_adapter: wpcli\n\nlocal:\n  vhost: http://vhost.local\n  wordpress_path: /home/john/sites/your_site # use an absolute path here\n\n  database:\n    name: database_name\n    user: user\n    password: password\n    host: localhost\n\n  # paths: # you can customize wordpress internal paths\n  #   wp_content: wp-content\n  #   uploads: wp-content/uploads\n  #   plugins: wp-content/plugins\n  #   themes: wp-content/themes\n  #   languages: wp-content/languages\n\nproduction:\n  vhost: http://example.com\n  wordpress_path: /var/www/your_site # use an absolute path here\n\n  database:\n    name: database_name\n    user: user\n    password: password\n    host: host\n    # port: 3308 # Use just in case you have exotic server config\n    # mysqldump_options: --max_allowed_packet=50MB # Only available if using SSH\n    # mysql_options: --protocol=TCP # Only available if using SSH\n\n  exclude:\n    - '.git/'\n    - '.gitignore'\n    - 'node_modules/'\n    - 'bin/'\n    - 'tmp/*'\n    - 'Gemfile*'\n    - 'Movefile'\n    - 'movefile'\n    - 'movefile.yml'\n    - 'movefile.yaml'\n    - 'wp-config.php'\n    - 'wp-content/*.sql.gz'\n    - '*.orig'\n\n  ssh:\n    host: host\n    user: user\n\n#  hooks: # Remote hooks won't work with FTP\n#    push:\n#      before:\n#        - command: 'echo \"do something\"'\n#          where: local\n#          raise: false # raise is true by default\n#      after:\n#        - command: 'echo \"do something\"'\n#          where: remote\n#    pull:\n#      before:\n#        - command: 'echo \"do something\"'\n#          where: local\n#          raise: false\n#      after:\n#        - command: 'echo \"do something\"'\n#          where: remote\n```\n\nWe warmly **recommend to read the wiki articles**\n\n* [Multiple environments explained](https://github.com/welaika/wordmove/wiki/Multiple-environments-explained)\n* [Movefile configurations explained](https://github.com/welaika/wordmove/wiki/movefile.yml-configurations-explained)\n\nto understand more about  supported configurations.\n\n## Environment Variables\n\nWordmove allows the use of environment variables in your movefiles.\nThis is useful in order to protect sensitive variables and credentials, as well as make it easy to share movefiles between your team.\n\nEnvironment variables are written using the **ERB tags** syntax:\n```\n\"\u003c%= ENV['YOUR_SECRET_NAME'] %\u003e\"\n```\n\n### Variables set up\n\nEnvironment variables can be set up using two methods:\n\n#### Using the shell:\n```bash\n# bash\nexport PROD_DB_USER=\"username\" PROD_DB_PASS=\"password\"\n\n# fish\nset --export --global PROD_DB_USER \"username\"; set --export --global PROD_DB_PASS \"password\"\n```\n#### Using a `.env` file:\n\nWordmove supports the [dotenv](https://github.com/bkeepers/dotenv) module.\n\nSimply create a `.env` file next to your movefile structured as follows:\n```bash\nPROD_DB_USER=\"username\"\nPROD_DB_PASS=\"password\"\n```\nWordmove will take care of loading the file  and making the environment variables ready to be used in your configuration file.\n\nYou may also use `.env.{environmentname}`, but this is discouraged.\n\n### Use them in your `movefile.yml`\nUsing the ERB syntax described above, write your movefile as follows:\n```yaml\nproduction:\n  database:\n    user: \"\u003c%= ENV['PROD_DB_USER'] %\u003e\"\n    password: \"\u003c%= ENV['PROD_DB_PASS'] %\u003e\"\n```\n\n### System variables\nYou can use system variables to configure your movefile.\n\nFor example:\n```yaml\nlocal:\n  vhost: \"http://wordpress-site.localhost\"\n  wordpress_path: \"\u003c%= ENV['HOME'] %\u003e/[wordpress directory path]/\"\n  # wordpress_path will be substituted with /home/user_name/[wordpress directory path]\n```\n\n## Supports\n\n### OS\n\nOS X and Linux are fully supported.\n\nSee the [Windows (un)support disclaimer](https://github.com/welaika/wordmove/wiki/Windows-(un)support-disclaimer)\n\n### Docker\n\nWe have a docker image bringing the latest Wordmove's version with autobuild on new releases.\n\n[![Docker Build Status](https://img.shields.io/docker/automated/welaika/wordmove.svg)](https://hub.docker.com/r/welaika/wordmove/)\n\n### SSH\n\n* You need `rsync` on your machine; as far as we know it's already installed on OS X and Linux.\n* To use your SSH public key for authentication, just delete the `production.ssh.password` field in your `movefile.yml`. Easy peasy.\n* writing the password inside `movefile.yml` was and is somewhat supported, but **we discourage this practice** in favor of password-less authentication with pub key. Read [here](https://github.com/welaika/wordmove/wiki/%5Bdeprecated%5D-SSH-password-inside-Movefile) for old informations.\n\n### FTP and SFTP\n\n* You need to install `lftp` on your machine. See community wiki article: [Install lftp on OSX yosemite](https://github.com/welaika/wordmove/wiki/Install-lftp-on-OSX-yosemite)).\n* Use the relative FTP path as `production.wordpress_path`\n* Use the absolute FTP path as `production.wordpress_absolute_path` (you may need to recover this from the `__FILE__` [magic constant](http://php.net/manual/en/language.constants.predefined.php)\n* if you want to specify a passive FTP connection add to the YAML config a `production.ftp.passive` flag and set it to `true`.\n\nFTP support development is [discontinued](https://github.com/welaika/wordmove/wiki/FTP-support-disclaimer), but it's always there.\n\nSice version 3.2.0 SFTP is fully supported, with same functionalities as FTP, through `production.ftp.scheme`\nconfiguration. More information found in the wiki.\n\n## Notes\n\n### Mirroring\n\nPush and pull actions on files will perform a **mirror** operation. Please, keep\nin mind that to mirror means to transfer new/updated files **and remove files**\nfrom destination if not present in source.\n\nThis means that if you have files/directories on your remotes which you must\npreserve, you **must exclude those in your movefile.yml**, or they will be\ndeleted.\n\n### How the heck you are able to sync the DB via FTP?\n\nWe're glad you asked! We basically upload via FTP a PHP script that performs the various\nimport/export operations. This script then gets executed via HTTP. Don't worry\ntoo much about security though: the script is deleted just after the usage,\nand can only be executed by `wordmove`, as each time it requires a pre-shared\none-time-password to be run.\n\n### Yanked versions\n\nWordmove `1.3.1` has been removed from `rubygems` due to a bug with FTP deploying system. If you are\nusing this version, please update soon (`gem update wordmove`).\n\n## Need more tools?\nVisit [Wordpress Tools](https://www.wptools.it).\n\n## Credits\n\n* The dump script is the [`MYSQL-dump` PHP package](https://github.com/dg/MySQL-dump) by David Grudl\n* The import script used is the [BigDump](http://www.ozerov.de/bigdump/) library\n\n## Contribute\n\nPlease, read the [contributor guide](https://github.com/welaika/wordmove/blob/master/CONTRIBUTING.md).\n\nFeel free to open a discussion issue about contribution if you need more info.\n\n## Author\n\nmade with ❤️ and ☕️ by [weLaika](https://dev.welaika.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwelaika%2Fwordmove","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwelaika%2Fwordmove","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwelaika%2Fwordmove/lists"}