ZOMEKIのデータベースをサイト単位でバックアップするプラグインです。
- ZOMEKI3 build-70+
Gemfileに追加します。
gem 'zplugin3-sitebk', github: 'zomeki/zplugin3-sitebk'
以下を実行します。
$ bundle
サイトID=1のデータをダンプします。
bundle exec rake zomeki:db:site:dump SITE_ID=1
ダンプファイルはHOME/sites/SITE_ID/db以下に保存されます。保存ディレクトリを変更する場合は次のようにします。
bundle exec rake zomeki:db:site:dump SITE_ID=1 DIR=/path/to/your/dir
全サイトのデータをダンプします。
bundle exec rake zomeki:db:site:dump_all
サイトID=1のデータをリストアします。
bundle exec rake zomeki:db:site:restore SITE_ID=1
バックアップ対象はin_site
スコープが定義済のモデルです。
class Cms::Content < ApplicationRecord
scope :in_site, ...
end
The gem is available as open source under the terms of the MIT License.