[DTI]ServersMan@VPS:DrupalをCUIアップデートする(drush)

ソフマップ・ドットコム

drushとは、DrupalをCUIコマンドラインで操作するためのツールです。このツールを使って、Drupalのセキュリティーアップデートを行います。(2013/08/04作成)

1.必要ツールをインストールする。

$ sudo pear channel-discover pear.drush.org
$ sudo pear install drush/drush
$ sudo pear install Console_Table
$ sudo drush --version
drush version 5.9

2.Druaplコアのみをアップデートする。
※drushは、druaplをインストールしたディレクトリ直下で実行します。

$ cd /home/drupal
$ sudo drush up drupal
hostname: 不明なホスト
利用可能なアップデートを確認中...                               [ok]
Update information last refreshed: 2013, 8月 25 - 10:25午前

Update status information on all installed and enabled Drupal projects:
 名前    インスト?  Proposed  状態                                             
         ??ル済み?    version                                                    
         ?ージョン                                                             
 Drupal  7.22      7.23      アップデートが利用可能です                       

Code updates will be made to drupal core.
WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.
Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.

Do you really want to continue? (y/n): y
Project drupal was updated successfully. Installed version is now 7.23.
Backups were saved into the directory                                          [ok]
/root/drush-backups/drupal/20130825013215/drupal.
hostname: 不明なホスト
'all' cache was cleared in /home/drupal#default                                [success]
You have pending database updates. Run `drush updatedb` or visit update.php in [warning]
your browser.
hostname: 不明なホスト
The following updates are pending:

image module : 
  7005 -   Add a column to the 'image_style' table to store administrative labels. 

Do you wish to run all pending updates? (y/n): y
hostname: 不明なホスト
Performed update: image_update_7005                                            [ok]
Finished performing updates.                                                   [ok]

※drush実行ユーザーのホームディレクトリ直下に「drush-backups」が作成され、drupalデータベースのバックアップが作成されます。

以上


About yoshimasa

埼玉県さいたま市在住、2男3女のパパです。Linux系の技術情報を中心にまとめています。1978年2月生まれ。