Drupal8からDrupal9にアップデートする方法

  •  
 
ズィスト2020年11月24日 - 17:47 に投稿

タグ

はじめに

Drupal9が公開されて半年が経とうとしています。
D9に触れる機会がなかなかなかったのですが、時間ができたためローカルの環境をD8からD9にアップデートしました。
その時の手順を公開します。
今回はDrupal8.9.5から9.0.8にアップデートしました。

手順

手順は以下の通りとなります。

  1. バックアップを取得する。

  2. サイトの状態を確認する。

  3. D9への更新

バックアップの取得

何も発生しなければ良いのですが、念の為バックアップを取得します。
取得するのはDBとDrupal Root以下のファイル全てになります。

サイトの状態の確認

Upgrade Statusモジュールを使用してD9にアップデートできる状態かどうかを確認します。
私の場合は以下の結果となり、すぐにアップデートできない状態でした。

アップデート前1  アップデート前2

apacheと「adminimal」テーマを更新し、「moderation scheduler」モジュールを無効化にした結果がこちらです。

作業後

これでアップデートできる状態になりました。

D9へのアップデート

公式ドキュメントにある手順の通りコマンドを実行します。


$ chmod 777 sites/default
$ find sites/default -name "*settings.php" -exec chmod 777 {} \;
$ find sites/default -name "*services.yml" -exec chmod 777 {} \;
$ composer require drupal/core-recommended:^9.0.0 drupal/core-composer-scaffold:^9.0.0 drupal/core-project-message:^9.0.0 --update-with-dependencies --no-update
$ php -d memory_limit=-1 /usr/local/bin/composer update
$ drush updatedb
 [error]   (Currently using Incompatible module Array) 

 Requirements check reports errors. Do you wish to continue? (yes/no) [yes]:
 > yes

 -------- ----------- ------------- ----------------------------------------------- 
  Module   Update ID   Type          Description                                    
 -------- ----------- ------------- ----------------------------------------------- 
  system   entit       post-update   Remove backwards-compatibility leftovers from  
           y_rev                     entity type definitions.                       
           ision                                                                    
           _meta                                                                    
           data_                                                                    
           bc_cl                                                                    
           eanup                                                                    
  system   unins       post-update   Uninstall Classy if it is no longer needed.    
           tall_                                                                    
           class                                                                    
           y                                                                        
  system   unins       post-update   Uninstall entity_reference.   @see             
           tall_                     https:www.drupal.orgprojectdrupalissues311164  
           entit                     5                                              
           y_ref                                                                    
           erenc                                                                    
           e_mod                                                                    
           ule                                                                      
  system   unins       post-update   Uninstall SimpleTest.   @see                   
           tall_                     https:www.drupal.orgprojectdrupalissues311086  
           simpl                     2                                              
           etest                                                                    
  system   unins       post-update   Uninstall Stable if it is no longer needed.    
           tall_                     This needs to run after                        
           stabl                     system_post_update_uninstall_classy(). This    
           e                         will be  the case since                        
                                     getAvailableUpdateFunctions() returns an       
                                     alphabetically sorted  list of post_update     
                                     hooks to be run.   @see                        
                                     Drupal\Core\Update\UpdateRegistry::getAvailab  
                                     leUpdateFunctions()                            
 -------- ----------- ------------- ----------------------------------------------- 

 Do you wish to run the specified pending updates? (yes/no) [yes]:
 > yes

>  [notice] Update started: system_post_update_entity_revision_metadata_bc_cleanup
>  [notice] Update completed: system_post_update_entity_revision_metadata_bc_cleanup
>  [notice] Update started: system_post_update_uninstall_classy
>  [notice] Update completed: system_post_update_uninstall_classy
>  [notice] Update started: system_post_update_uninstall_entity_reference_module
>  [notice] Update completed: system_post_update_uninstall_entity_reference_module
>  [notice] Update started: system_post_update_uninstall_simpletest
>  [notice] Update completed: system_post_update_uninstall_simpletest
>  [notice] Update started: system_post_update_uninstall_stable
>  [notice] Update completed: system_post_update_uninstall_stable
 [success] Finished performing updates.

これでアップデートが完了しました。
アップデート前にしなければいけないことがもっとあるのかなと思ったのですが、思ったより作業が少なかったです。
アップデート後にD9の画面を見ましたが見た目はD8とあまり変わりませんでした。

<a href=https://fabrika-teplic.ru>Сайт теплицы</a>.
<a href=https://fabrika-teplic.ru/>Теплицы из поликарбоната цена</a>.
<a href=https://fabrika-teplic.ru/#1>Усиленные теплицы из поликарбоната от производителя купить</a>.
<a href=https://fabrika-teplic.ru/#2>Теплицы из поликарбоната цена</a>.
<a href=https://fabrika-teplic.ru/#3>Теплица прямостенные цена</a>.
<a href=https://fabrika-teplic.ru/#4>Производство теплиц из поликарбоната</a>.

コメントを追加

プレーンテキスト

  • HTMLタグは利用できません。
  • 行と段落は自動的に折り返されます。
  • ウェブページのアドレスとメールアドレスは自動的にリンクに変換されます。
CAPTCHA
この質問はあなたが人間の訪問者であるかどうかをテストし、自動化されたスパム送信を防ぐためのものです。