sync_wordpress.sh

wordpress

sync_wordpress.sh syncs WordPress, files, plugins, themes, and options stored in the database from one WordPress instance to another. The database options are also checked into a Subversion repository.

It uses rsync to synchronize files, including WordPress itself, themes, plugins, and config files. It then uses mysqldump to dump non-transient options in the wp_options table, diffs the dump against Subversion head, and checks it in. Finally, it diffs the dump against the remote database and applies it.

mysql

The user is prompted at each step and may choose whether to copy and update files, check in the new dump, and apply it remotely. The source and destination hostnames, directories, and database connection parameters are configurable in variables at the top of the script.

(There are plenty of other related approaches, e.g. the Remote Database Backup plugin.)

Note: sync_wordpress.sh does not synchronize posts, pages, comments, or other content.

One thought on “sync_wordpress.sh

  1. Pingback: Deploying Updated or New Plugins That Modify the wp_options Table – Read For Learn

Leave a Reply

Your email address will not be published. Required fields are marked *