Updatenotizen Drupal 8 auf Drupal 9

Sat, 29/05/2021 - 23:42
Body

Private Updatenotizen Drupal 8 auf Drupal 9

https://www.drupal.org/docs/updating-drupal/updating-drupal-core-via-composer

Drupal 8 läuft irgendwie nicht auf php 8? DOCH TUT ES. Das Problem sind die Ketten-Dependecies mal wieder. Indem Fall drush und composer.

Neun aber, ich muss aber von 8 nach 9 ....

Php ist nunmal aktuell und ich hab null bock jetzt hier mit dockerkram oder vms anzufangen. Viel zu viel Aufwand mal wieder. Auf in den Kampf!

 

1) CEX geht nicht weil module msising erro config blabla

site_map usw

Also folgendes nutzen: https://www.drupal.org/project/module_missing_message_fixer

 

 

2) Radix Theme updates 3 -> 4

Es fallen einige files weg! Also nicht einfach nur reinkopieren! ordner löschen und neuen ordner rein, siehe templates etc!

 

3) Update alte PD4 D8 auf D9

Entferne alte Module mit einem etwas hacky way.

Beachte auch das PHP Problem 8 und 9!!!!

Bei meinem hoster läuft auf der cli eine 7er Version .Wir geben also alles manuell an weil D9 8 will.

CLI Version ändern: https://all-inkl.com/wichtig/anleitungen/kas/ssh/dateiverwaltung/aenderung-der-php-cli-version_527.html?suche=php.ini&textsuche=ja

 

ACHTUNG! Aus irgend einem Grund findet er mit D9 den Sql Server nicht wenn wir da "localhost" eingetragen haben. Auch 127.0.0.1 geht nicht. Die IP des Servers klappt allerdings

War ein all inkl Problem, die haben das gelöst lag an der CLI Änderung

Beispiel ohne CLI Version ändern

/usr/bin/php80 /www/htdocs/w00bbe43/DISTRI_D9/vendor/drush/drush/drush stat
us
 

  1. Die Distri ist auf D9 lokal aktualisiert.
  2. Datanbank der Seite rein und dann drush updb.
  3. drush php:eval '\Drupal::configFactory()->getEditable("core.extension")->clear("module.site_map")->save(TRUE);'
  4. drush php:eval '\Drupal::configFactory()->getEditable("core.extension")->clear("module.views_responsive_grid")->save(TRUE);'
  5. drush cr
  6. Sitemap Modul aktivieren!

 

 

4) Problem 1

Lokal klappts natürlich direkt nicht weil ich php 8 drauf habe. Here we go, i love it always

composer update drupal/core "drupal/core-*" --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

 Problem 1
   - Root composer.json requires composer/installers ^1.2 -> satisfiable by composer/installers[v1.7.0].
   - composer/installers v1.7.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
 Problem 2
   - league/container 2.4.1 requires php ^5.4.0 || ^7.0 -> your php version (8.0.6) does not satisfy that requirement.
   - drush/drush 10.3.6 requires league/container ~2 -> satisfiable by league/container[2.4.1].
   - drush/drush is locked to version 10.3.6 and an update of this package was not requested.
 

 

5) Idee 1: Platform requests ignorieren EINS ZWEI RISIKO!!!

composer update drupal/core "drupal/core-*" --with-all-dependencies --ignore-platform-reqs

Result:

[RuntimeException]                                                                                                                                                                               
 Could not scan for classes inside "/srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drupal/devel/.spoons/ScriptHandler.php" which does not appear to be a file nor a folder

NOCHMAL AUSFÜHREN! WIR GEBEN NICHT AUF!

INSTALL BROKEN, DRUPAL Does not load YEA...

LOGS

Sat May 29 23:00:26.455726 2021] [php7:error] [pid 30069] [client 127.0.0.1:46684] PHP Fatal error:  Cannot redeclare config_get_config_directory() (previously declared in /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/web/core/includes/bootstrap.inc:214) in /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drupal/core/includes/bootstrap.inc on line 214, referer: http://dev9.funkkopfhoerer-infos.de/users/marco
[Sat May 29 23:00:27.481331 2021] [php7:error] [pid 30067] [client 127.0.0.1:46686] PHP Fatal error:  Cannot redeclare config_get_config_directory() (previously declared in /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/web/core/includes/bootstrap.inc:214) in /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drupal/core/includes/bootstrap.inc on line 214, referer: http://dev9.funkkopfhoerer-infos.de/users/marco
[Sat May 29 23:00:27.981060 2021] [php7:error] [pid 30068] [client 127.0.0.1:46688] PHP Fatal error:  Cannot redeclare config_get_config_directory() (previously declared in /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/web/core/includes/bootstrap.inc:214) in /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drupal/core/includes/bootstrap.inc on line 214, referer: http://dev9.funkkopfhoerer-infos.de/users/marco
[Sat May 29 23:00:28.215196 2021] [php7:error] [pid 30078] [client 127.0.0.1:46690] PHP Fatal error:  Cannot redeclare config_get_config_directory() (previously declared in /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/web/core/includes/bootstrap.inc:214) in /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drupal/core/includes/bootstrap.inc on line 214, referer: http://dev9.funkkopfhoerer-infos.de/users/marco
[Sat May 29 23:00:31.304529 2021] [php7:error] [pid 30071] [client 127.0.0.1:46692] PHP Fatal error:  Cannot redeclare config_get_config_directory() (previously declared in /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/web/core/includes/bootstrap.inc:214) in /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drupal/core/includes/bootstrap.inc on line 214, referer: http://dev9.funkkopfhoerer-infos.de/users/marco
[Sat May 29 23:00:36.758058 2021] [php7:error] [pid 30070] [client 127.0.0.1:46694] PHP Fatal error:  Cannot redeclare config_get_config_directory() (previously declared in /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/web/core/includes/bootstrap.inc:214) in /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drupal/core/includes/bootstrap.inc on line 214

 

SUPER....

 

6) Idee 2, direkt update von 8 auf 9 im Rambo-Style

https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-to-drupal-9-or-later

 

7) Kopiere original 1:1

weiter TODO

 

8) your php version (8.0.0) does not satisfy that requirement.

https://www.devopsschool.com/blog/composer-update-fails-with-composer-json-php-version-7-1-3/

composer install --ignore-platform-reqs

 

 

 

PHP Fatal error:  Declaration of Drupal\Core\Database\Statement::fetchAll($mode = null, $column_index = null, $constructor_arguments = null) must be compatible with PDOStatement::fetchAll(int $mode = PDO::FETCH_BOTH, mixed ...$args) in
/srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/web/core/lib/Drupal/Core/Database/Statement.php on line 169

Liegt an php 8 der cli-..... also php7 nutzen "php7 /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drush/drush/drush
"

 

9) So Update D8 -> D9

  1. Erstmal alte module, nicht genutzte entfernen!!
  2. Update je nachdem V1 nach V2 module etc.
  3. prüfe das per Upgrade Modul

 

Entferne alten Kram!  Als php 7 laufenm lassen, lokal rennt 7 und 8!!

  • /usr/bin/php7 /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drush/drush/drush pm:uninstall at_theme_generator && composer remove drupal/at_theme_generator --ignore-platform-reqs
  • /usr/bin/php7 /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drush/drush/drush pm:uninstall at_tools
    && composer remove drupal/at_tools --ignore-platform-reqs
  • /usr/bin/php7 /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drush/drush/drush pm:uninstall devel
    && composer remove drupal/devel --ignore-platform-reqs
  • /usr/bin/php7 /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drush/drush/drush pm:uninstall embed_view_block && composer remove drupal/embed_view_block --ignore-platform-reqs
  • /usr/bin/php7 /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drush/drush/drush pm:uninstall examples && composer remove drupal/examples --ignore-platform-reqs
  • /usr/bin/php7 /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drush/drush/drush pm:uninstall migrate_file_to_media && composer remove drupal/migrate_file_to_media --ignore-platform-reqs
  • /usr/bin/php7 /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drush/drush/drush pm:uninstall migrate_file && composer remove drupal/migrate_file --ignore-platform-reqs
  • /usr/bin/php7 /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drush/drush/drush pm:uninstall media_entity_browser && composer remove drupal/media_entity_browser --ignore-platform-reqs
  • /usr/bin/php7 /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drush/drush/drush pm:uninstall media_entity && composer remove drupal/media_entity --ignore-platform-reqs
  • /usr/bin/php7 /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drush/drush/drush pm:uninstall site_map && composer remove drupal/site_map --ignore-platform-reqs
  • /usr/bin/php7 /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drush/drush/drush pm:uninstall views_responsive_grid && composer remove drupal/views_responsive_grid --ignore-platform-reqs

 

Info

Search Exclude wird nur von BTL genutzt. Die beta 2 ist D9 kompatibel

  • composer require drupal/search_exclude:2.0.0-beta2 --ignore-platform-reqs

Prüfe ob das in D9 läuft! Auf BTL

 

Update gewisse Module auf neue version oder betas für D9 Kompatibilität

  • composer require drupal/advanced_text_formatter:2.0.0 --ignore-platform-reqs
  • composer require drupal/linkit:6.0.0-beta2 --ignore-platform-reqs
  • composer require drupal/entity --ignore-platform-reqs
  • composer require drupal/existing_values_autocomplete_widget:2.0.0-alpha2 --ignore-platform-reqs
  • composer require drupal/typed_data:1.x-dev --ignore-platform-reqs
  • composer require drupal/rules:3.0-alpha6 --ignore-platform-reqs
  • composer require drupal/imageapi_optimize:4.0.0-beta1 --ignore-platform-reqs
  • composer require drupal/recaptcha:3.0 --ignore-platform-reqs
  • composer require drupal/webform:6.0.3 --ignore-platform-reqs
  • composer require drupal/insert_view:2.0.0 --ignore-platform-reqs
  • composer require drupal/search404:2.0.0 --ignore-platform-reqs
  • composer require drupal/search_autocomplete:2.0.1 --ignore-platform-reqs
  • composer require drupal/taxonomy_manager:2.0.4 --ignore-platform-reqs
  • composer require drupal/better_exposed_filters:5.0-beta1 --ignore-platform-reqs
  • composer require drupal/plupload:2.0.0-beta1 --ignore-platform-reqs
  • composer require drupal/computed_field:3.0.0-alpha2 --ignore-platform-reqs
  • composer require drupal/imageapi_optimize_resmushit:2.0.0-beta1 --ignore-platform-reqs
  • composer require drupal/photoswipe:3.0.0-alpha0 --ignore-platform-reqs
  • composer require drupal/taxonomy_menu:3.x-dev --ignore-platform-reqs
  • composer require drupal/sitemap:2.0-beta2  --ignore-platform-reqs
  • composer require 'drupal/amazon_pa:2.0.x-dev@dev' --ignore-platform-reqs
  •  

 

WICHTIG: Linkit, Rules etc.!!! braucht die entity api contrib danach muss der cache neu erzeugt werden

  • /usr/bin/php7 /srv/http/WORKSPACE_DRUPAL/EIGENE_PROJEKTE/PRODUCT_DISTRI_D9/vendor/drush/drush/drush cr
     

WICHTIG: site_map wurde verschoben in sitemap also neuinstall. Link bleibt aber gleich /sitemap

Wird views_responsive_grid irgendwoe genutzt??? Weil das muss weg das modul

 

Müssen wir durch die ganzen speziellen Versions requirements das später wieder in der json ändern für zukünftige Updates?

 

10) Ok, nachdem ganzen Kram UPDATE 8->9

https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-to-drupal-9-or-later

PASSE DIE VERSIONSNUMMERN AN NATÜRLICH!!!

 

1..2..3 ... NATÜRLICH irgendwelche dependency fehler

- drupal/core 8.0.0-beta6 requires doctrine/common dev-master#a45d110f71c323e29f41eb0696fa230e3fa1b1b5 -> found doctrine/common[2.1.3, ..., 2.13.x-dev, 3.0.0, ..., 3.2.x-dev] but it does not match the constraint.
   - Root composer.json requires drupal/views_tree ^2.0@alpha -> satisfiable by drupal/views_tree[2.0.0-alpha1].
   - drupal/core-recommended 9.3.x-dev requires drupal/core 9.3.x-dev -> satisfiable by drupal/core[9.3.x-dev].
   - Conclusion: don't install drupal/core 9.3.x-dev (conflict analysis result)
   - drupal/core-recommended 9.2.0-alpha1 requires drupal/core 9.2.0-alpha1 -> satisfiable by drupal/core[9.2.0-alpha1].
   - Conclusion: don't install drupal/core 9.2.0-alpha1 (conflict analysis result)
   - drupal/core-recommended 9.2.0-beta1 requires drupal/core 9.2.0-beta1 -> satisfiable by drupal/core[9.2.0-beta1].
   - Conclusion: don't install drupal/core 9.2.0-beta1 (conflict analysis result)
   - drupal/core-recommended 9.2.0-beta2 requires drupal/core 9.2.0-beta2 -> satisfiable by drupal/core[9.2.0-beta2].
   - Conclusion: don't install drupal/core 9.2.0-beta2 (conflict analysis result)
   - drupal/core-recommended 9.2.0-beta3 requires drupal/core 9.2.0-beta3 -> satisfiable by drupal/core[9.2.0-beta3].
   - Conclusion: don't install drupal/core 9.2.0-beta3 (conflict analysis result)
   - drupal/core-recommended 9.2.0-rc1 requires drupal/core 9.2.0-rc1 -> satisfiable by drupal/core[9.2.0-rc1].
   - Conclusion: don't install drupal/core 9.2.0-rc1 (conflict analysis result)
   - drupal/core-recommended 9.1.10 requires drupal/core 9.1.10 -> satisfiable by drupal/core[9.1.10].
   - Conclusion: don't install drupal/core 9.1.10 (conflict analysis result)
   - drupal/core-recommended 9.2.x-dev requires drupal/core 9.2.x-dev -> satisfiable by drupal/core[9.2.x-dev].
   - Conclusion: don't install drupal/core 9.2.x-dev (conflict analysis result)
   - drupal/views_tree 2.0.0-alpha1 requires drupal/core ^8 -> satisfiable by drupal/core[8.0.0-beta6, ..., 8.9.x-dev].
   - You can only install one version of a package, so only one of these can be installed: drupal/core[8.0.0-beta6, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.3.x-dev].
   - You can only install one version of a package, so only one of these can be installed: drupal/core[8.0.0-beta12, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.3.x-dev].
   - You can only install one version of a package, so only one of these can be installed: drupal/core[8.0.0-beta16, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.3.x-dev].
   - You can only install one version of a package, so only one of these can be installed: drupal/core[8.0.0-rc3, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.3.x-dev].
   - You can only install one version of a package, so only one of these can be installed: drupal/core[8.4.0-alpha1, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.3.x-dev].
   - You can only install one version of a package, so only one of these can be installed: drupal/core[8.4.0-rc1, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.3.x-dev].
   - drupal/core-recommended 9.1.x-dev requires drupal/core 9.1.x-dev -> satisfiable by drupal/core[9.1.x-dev].
   - Root composer.json requires drupal/core-recommended ^9.1.10 -> satisfiable by drupal/core-recommended[9.1.10, ..., 9.3.x-dev].

Ok entfernen wir mal alles manuell aus der composer.json

  • starttaring
  • views_tree
  • rules
  • radix
  • radix_layout
  • components
  • session_cache
  • nofollowlist - cutsom module und D9 manuel ladden sonst probleme wenns kein uninstall gab

 

  • composer require drupal/components --ignore-platform-reqs
  • composer require drupal/radix:4.x-dev --ignore-platform-reqs
     

Ein paar einzelne haben noch faxen gemacht, dann eben kurz gehackt und "core_version_requirement: ^8 || ^9" geadded. Später können wir die noch entfernen etc.

 

Soweit so gut.

 

 

Back to top