Zum Inhalt springen

Drupal 8 zu Drupal 9 Migration: Unterschied zwischen den Versionen

Aus Computech CMS Wiki
Simon Zeberli (Diskussion | Beiträge)
Haas (Diskussion | Beiträge)
 
(28 dazwischenliegende Versionen von 3 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
==Grundlage==
* Scriptpfad <code>~/_scripts/d9_upgrade</code>
* Script Start <code>./d9_upgrade.sh PROJEKTNAME</code>
==Migration Vorbereite==
==Migration Vorbereite==
* Die Webseite vorab Auf den neusten Stand bringen $lokal <code>composer update -W</code>
* DB Update $lokal <code>drush updb</code>
* Synchronisieren $local <code>sync PROJETNAME</code>
Mögliche updates die manuell gemacht werden müssen:
Mögliche updates die manuell gemacht werden müssen:
<syntaxhighlight line='line' lang="bash">
<syntaxhighlight line='line' lang="bash">
Zeile 23: Zeile 30:
</syntaxhighlight>
</syntaxhighlight>


==egw==
'''Nur EGW'''
<syntaxhighlight line='line' lang="bash">
<syntaxhighlight line='line' lang="bash">
composer require 'drupal/linkit:^6.0@beta' 'drupal/field_formatter_filter:^2.0' 'drupal/single_datetime:1.x-dev@dev' 'drupal/computed_field:^3.0@alpha'
composer require 'drupal/linkit:^6.0@beta' 'drupal/field_formatter_filter:^2.0' 'drupal/single_datetime:1.x-dev@dev' 'drupal/computed_field:^3.0@alpha'
Zeile 30: Zeile 37:


==Alle==
==Alle==
composer.json Webroot für Scaffolding:
* '''von D9/dev9''' -> "''patches''" Ordner kopieren in '''D9/Projekt'''
* '''D9/Projekt'''/composer.json  
'''ersetzten'''
<syntaxhighlight line='line' lang="bash">
<syntaxhighlight line='line' lang="bash">
        "drupal-scaffold": {
            "conflict": {
            "locations": {
                "drupal/drupal": "*"
            },
            "minimum-stability": "dev",
            "prefer-stable": true,
            "config": {
                "sort-packages": true
            },
            "extra": {
                "enable-patching": true,
                "patches-file": "patches/composer.json",
                "drupal-scaffold": {
                "locations": {
                 "web-root": "web/"
                 "web-root": "web/"
             },
                }
</syntaxhighlight>
              },
              "installer-paths": {
<syntaxhighlight line='line' lang="bash">
                "web/core": [
composer config extra.enable-patching true
                  "type:drupal-core"
composer config extra.patches-file "https://raw.githubusercontent.com/szeberli/ct_composer-patches/main/composer.patches.json"
                  ],
                "web/libraries/{$name}": [
                  "type:drupal-library"
                  ],
            "web/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "web/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "web/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
             "drush/Commands/contrib/{$name}": [
                "type:drupal-drush"
            ],
            "web/modules/custom/{$name}": [
                "type:drupal-custom-module"
            ],
            "web/themes/custom/{$name}": [
                "type:drupal-custom-theme"
            ]
        },
        "drupal-core-project-message": {
            "include-keys": [
                "homepage",
                "support"
            ],
            "post-create-project-cmd-message": [
                "<bg=blue;fg=white>                                                        </>",
                "<bg=blue;fg=white>  Congratulations, you’ve installed the Drupal codebase  </>",
                "<bg=blue;fg=white>  from the drupal/recommended-project template!          </>",
                "<bg=blue;fg=white>                                                        </>",
                "",
                "<bg=yellow;fg=black>Next steps</>:",
                "  * Install the site: https://www.drupal.org/docs/8/install",
                "  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
                "  * Get support: https://www.drupal.org/support",
                "  * Get involved with the Drupal community:",
                "     https://www.drupal.org/getting-involved",
                "  * Remove the plugin that prints this message:",
                "      composer remove drupal/core-project-message"
            ]
        },
        "merge-plugin": {
            "include": [
                "web/modules/contrib/webform/composer.libraries.json"
            ]
        }
    }
</syntaxhighlight>
</syntaxhighlight>


D9 Lokal nach fertiggestelltem Upgrade
D9 Lokal nach fertiggestelltem Upgrade
<syntaxhighlight line='line' lang="bash">
<syntaxhighlight line='line' lang="bash">
patches && composer update && drush updb && drush cr
drush sql-dump > DB/DB_D9.sql
drush sql-dump > DB/DB_D9.sql
drush cex -y
drush cex -y
Zeile 52: Zeile 122:
</syntaxhighlight>
</syntaxhighlight>


Online -> Ordner löschen
==Zum Online Stellen==
* <code>web/core/vendor</code>
*<big>ONLINE [Ausser EGW]</big>
* <code>web/core/modules/</code>
<big>BEVOR</big> Online Stellen folgende Ordner vom <big>ONLINE</big> löschen
* <code>web/themes/contrib/</code>
*<code>web/core/vendor</code>
 
*<code>web/core/modules/</code>
==Ausser EGW ==
*<code>web/themes/contrib/</code>
===D9 Lokal===
*<big>D9 Lokal</big>
<code>sync projektname</code>
<code>sync PROJEKTNAME -d</code>
 
<code>sync PROJEKTNAME </code>
===Online===
*Online
<syntaxhighlight line='line' lang="bash">
<syntaxhighlight line='line' lang="bash">
drush updb -y
drush updb -y
drush theme:enable gin
drush theme:enable gin
en -y gin_toolbar  
drush en -y gin_toolbar  
drush cim
drush cim
drush cr
drush cr
Zeile 71: Zeile 141:
</syntaxhighlight>
</syntaxhighlight>


==Nur für EGW===
===<big>Nur für EGW</big>===
<syntaxhighlight line='line' lang="bash">
<syntaxhighlight line='line' lang="bash">
composer require 'drupal/computed_field:^3.0@alpha'
composer require 'drupal/computed_field:^3.0@alpha'
Zeile 82: Zeile 152:
<syntaxhighlight line='line' lang="bash">
<syntaxhighlight line='line' lang="bash">
drush pmu -y configuration_import
drush pmu -y configuration_import
Module Löschen default_config
drush pmu -y default_config
</syntaxhighlight>
</syntaxhighlight>


Module Kopieren: egw_default_config
Module Aktuallisieren default_config
<syntaxhighlight line='line' lang="bash">
cd web/modules/custom/default_config
git pull
</syntaxhighlight>
 
'''Nur EGW''' Module Kopieren: egw_default_config
<syntaxhighlight line='line' lang="bash">
drush en -y egw_default_config
drush en -y egw_default_config
 
</syntaxhighlight>


==alle==
==alle==
Zeile 100: Zeile 175:
</syntaxhighlight>
</syntaxhighlight>


==Pre resync==
==Pre rsync==
<syntaxhighlight line='line' lang="bash">
<syntaxhighlight line='line' lang="bash">
$live chmod -R 755 web/modules/custom/
$live chmod -R 755 web/modules/custom/
</syntaxhighlight>
</syntaxhighlight>

Aktuelle Version vom 7. Juni 2022, 10:00 Uhr

Grundlage

  • Scriptpfad ~/_scripts/d9_upgrade
  • Script Start ./d9_upgrade.sh PROJEKTNAME

Migration Vorbereite

  • Die Webseite vorab Auf den neusten Stand bringen $lokal composer update -W
  • DB Update $lokal drush updb
  • Synchronisieren $local sync PROJETNAME

Mögliche updates die manuell gemacht werden müssen:

composer require 'drupal/linkit:^6.0@beta'
composer require 'drupal/field_formatter_filter:^2.0'
composer require 'drupal/backup_migrate:^5.0'
composer require 'drupal/db_maintenance:^2.0'
composer require 'drupal/single_datetime:1.x-dev@dev'
composer require 'drupal/computed_field:^3.0@alpha'
composer require 'drupal/crop:^2.1'
composer require 'drupal/field_group:^3.2'
composer require 'drupal/responsive_menu:^4.4'

wenn devel nicht aktuell ist:

zuerst kint deinstallieren

drush pm:uninstall kint
composer remove drupal/kint --no-update
composer require kint-php/kint
composer require 'drupal/devel:^4.1'

Nur EGW

composer require 'drupal/linkit:^6.0@beta' 'drupal/field_formatter_filter:^2.0' 'drupal/single_datetime:1.x-dev@dev' 'drupal/computed_field:^3.0@alpha'
composer rem drupal/date_range_picker

Alle

  • von D9/dev9 -> "patches" Ordner kopieren in D9/Projekt
  • D9/Projekt/composer.json

ersetzten

            "conflict": {
                "drupal/drupal": "*"
             },
             "minimum-stability": "dev",
             "prefer-stable": true,
             "config": {
                "sort-packages": true
             },
             "extra": {
                "enable-patching": true,
                "patches-file": "patches/composer.json",
                "drupal-scaffold": {
                "locations": {
                "web-root": "web/"
                }
              },
              "installer-paths": {
                 "web/core": [
                  "type:drupal-core"
                  ],
                 "web/libraries/{$name}": [
                  "type:drupal-library"
                  ],
            "web/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "web/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "web/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/Commands/contrib/{$name}": [
                "type:drupal-drush"
            ],
            "web/modules/custom/{$name}": [
                "type:drupal-custom-module"
            ],
            "web/themes/custom/{$name}": [
                "type:drupal-custom-theme"
            ]
        },
        "drupal-core-project-message": {
            "include-keys": [
                "homepage",
                "support"
            ],
            "post-create-project-cmd-message": [
                "<bg=blue;fg=white>                                                         </>",
                "<bg=blue;fg=white>  Congratulations, you’ve installed the Drupal codebase  </>",
                "<bg=blue;fg=white>  from the drupal/recommended-project template!          </>",
                "<bg=blue;fg=white>                                                         </>",
                "",
                "<bg=yellow;fg=black>Next steps</>:",
                "  * Install the site: https://www.drupal.org/docs/8/install",
                "  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
                "  * Get support: https://www.drupal.org/support",
                "  * Get involved with the Drupal community:",
                "      https://www.drupal.org/getting-involved",
                "  * Remove the plugin that prints this message:",
                "      composer remove drupal/core-project-message"
            ]
        },
        "merge-plugin": {
            "include": [
                "web/modules/contrib/webform/composer.libraries.json"
            ]
        }
    }

D9 Lokal nach fertiggestelltem Upgrade

patches && composer update && drush updb && drush cr
drush sql-dump > DB/DB_D9.sql
drush cex -y
git add .
git commit -m "D9 Upgrade lokal abgeschlossen"
git push origin master

Zum Online Stellen

  • ONLINE [Ausser EGW]

BEVOR Online Stellen folgende Ordner vom ONLINE löschen

  • web/core/vendor
  • web/core/modules/
  • web/themes/contrib/
  • D9 Lokal

sync PROJEKTNAME -d sync PROJEKTNAME

  • Online
drush updb -y
drush theme:enable gin
drush en -y gin_toolbar 
drush cim
drush cr
drush locale:check && drush locale:update

Nur für EGW

composer require 'drupal/computed_field:^3.0@alpha'
composer require 'drupal/field_formatter_filter:^2.0'
composer require 'drupal/linkit:^6.0@beta'
composer require 'drupal/single_datetime:^1.8@beta'

verteilen

drush pmu -y configuration_import

Module Aktuallisieren default_config

cd web/modules/custom/default_config
git pull

Nur EGW Module Kopieren: egw_default_config

drush en -y egw_default_config

alle

zeberliedvdefaults -> Löschen

Online

drush pmu -y me_redirect

Pre rsync

$live chmod -R 755 web/modules/custom/