wp-sync
  
  
  
  
  
  
  
    
  
    Tools
  
  
  
  
  
  
  
  
  
  
  
  
    
  
    Open Source
  
  
  
  
    
  
    Sync
  
  
  
  
    
  
    WordPress
  
  
  
  
  
  
    please take full responsibility for your actions
En
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
 
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
 
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
 
Ja
動作条件
- 
    UNIX系OS 
- Windows系は動作しない(有効化しても何もできないようにしてる)
 - 動作確認したのはCentOS 5.4/5.5のみ
 
 - 
    同期元と同期先の環境が同じサーバー 
- Web/DBとも同じ
 
 - 
    同期元と同期先のサイトURLが同じ階層構造 
- 階層が異なるとパーマリンク設定と.htaccessで問題起きそう
 
 - 同期元と同期先のDBのユーザー/パスワードが同じ
 - mysql,mysqldump,sed,rsyncがあり、パスが通っている
 - 同期先のディレクトリにWebサーバーユーザーの書き込み権限がある
 
使い方
- WordPressのpluginディレクトリに配置
 - 
    プラグインを有効化 
- メニューのツール配下にリンクができる
 
 - 
    同期先のディレクトリ、サイトURL、DB名を入力 
- バックアップディレクトリは入力しなくても動く
 
 - updateで設定反映
 - 上部ナビのSyncリンクよりコマンドの確認
 - do syncで同期実行
 
備考
- 
    rsyncはwp-config.php以外を同期 
- —deleteオプションにより同期元に存在しないファイルは削除
 
 - 
    バックアップディレクトリはrsyncで上書き/削除されたファイルの保存先 
- 同期前の同期先DBのダンプも保存
 
 - “excludes”に入力がある場合、プラグインのディレクトリにファイルを保存して—exclude-fromオプションを利用
 - rsyncは(エラー)出力があった場合プラグインのディレクトリにrsync.logで残る