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.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>