Home > wp-sync

wp-sync

Wp-sync is a project mainly written in PHP, it's free.

This is WordPress plugin. Synchronize WordPress resources (DB & files). ***UNIX based system only.***

please take full responsibility for your actions

h1. En

h2. Conditions

  • UNIX based server
  • source and destination WordPress in same server
  • source and destination have same site structure
  • source and destination use same database username and passward
  • required mysql, mysqldump, sed, rsync
  • set permission to dest dir writable

h2. Usage

  • copy into WordPress plugin dir
  • activate plugin
  • access plugin index page under "tool" menu
  • input your destination dir, site url and database name
  • click update settings
  • access plugin sync page
  • check commands
  • click do sync

h2. More info

  • synchronize files without "wp-config.php"
  • rsync use "--delete" option
  • "backup dir" get dest overwritten files and dest database dump
  • if "excludes" exists, rsync use "--exclude-from" option
  • when rsync error, write "rsync.log" in this plugin dir

h1. Ja

h2. 動作条件

  • UNIX系OS Windows系は動作しない(有効化しても何もできないようにしてる) 動作確認したのはCentOS 5.4/5.5のみ
  • 同期元と同期先の環境が同じサーバー ** Web/DB(MySQL)とも同じ
  • 同期元と同期先のサイトURLが同じ階層構造 ** 階層が異なるとパーマリンク設定と.htaccessで問題起きそう
  • 同期元と同期先のDBのユーザー/パスワードが同じ
  • mysql,mysqldump,sed,rsyncがあり、パスが通っている
  • 同期先のディレクトリにWebサーバーユーザーの書き込み権限がある

h2. 使い方

  • WordPressのpluginディレクトリに配置
  • プラグインを有効化 ** メニューのツール配下にリンクができる
  • 同期先のディレクトリ、サイトURL、DB名を入力 ** バックアップディレクトリは入力しなくても動く
  • updateで設定反映
  • 上部ナビのSyncリンクよりコマンドの確認
  • do syncで同期実行

h2. 備考

  • rsyncはwp-config.php以外を同期 ** --deleteオプションにより同期元に存在しないファイルは削除
  • バックアップディレクトリはrsyncで上書き/削除されたファイルの保存先 ** 同期前の同期先DBのダンプも保存
  • "excludes"に入力がある場合、プラグインのディレクトリにファイルを保存して--exclude-fromオプションを利用
  • rsyncは(エラー)出力があった場合プラグインのディレクトリにrsync.logで残る
Previous:test-5