LoginSignup
10
15

More than 5 years have passed since last update.

Drupal 本体 (core) を手軽にアップデートする方法

Last updated at Posted at 2016-08-20

Drupal core のアップデート

Drupal は管理画面からモジュールのアップデートが可能だが、本体 (core) は管理画面からアップデートできない。
また、コンソールでの作業でも、 cpmv などのコマンドは下階層のディレクトリーを上書きできないため、丸ごとまたは1ディレクトリーごとに差し替えるしかない。

しかし、Drush を使うと比較的容易にアップデートが可能になる。
ただし、.htaccess や robots.txt ファイルは上書きされるので注意。当然標準のテーマファイル等も上書きされる。

Drush による core のアップデート

バックアップ

drush ard

サイトに含まれる全てのファイルとデータベースをダンプしたファイルが tar.gz 形式に圧縮されて保存される。
バックアップされたファイルは通常 ~/drush-backups/archive-dump フォルダに保存される。
drush archive-dump に同じ。

メンテナンスモード開始

Drupal7
drush vset --exact maintenance_mode 1
drush cc all
Drupal8
drush sset system.maintenance_mode 1
drush cr

アップデート

drush up drupal

drush pm-update drupal に同じ。

動作確認

メンテナンスモード終了

Drupal7
drush vset --exact maintenance_mode 0
drush cc all
Drupal8
drush sset system.maintenance_mode 0
drush cr
10
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
15