Startseite
  • » Home
  • » Handbuch & FAQ
  • » Forum
  • » Übersetzungsserver
  • » Suche
Startseite › Forum › Drupalcenter.de › Allgemeines zu Drupal ›

[gelöst] drush 10.x - "migrate-upgrade" Befehl gibt Fehlermeldung aus: "Fatal error: Allowed memory size of XY bytes exhausted"

Eingetragen von pyretta (171)
am 30.01.2020 - 15:50 Uhr in
  • Allgemeines zu Drupal
  • Drupal 8.x

Hallo,

ich will eine Drupal 7 Installation in eine Drupal 8.8.1 Installation migrieren.

Erstmal die Ausgangssituation:
Mit dem Kern-Migrations-Tool habe ich bereits die Inhalte (teilweise) migrieren können. Dabei fehlten aber immer einige nodes und die Versionshistorie wurde auch nicht überspielt. Dann habe ich gelesen, dass mit drush die Möglichkeit besteht den Migrationsprozess gezielter und Schrittweise durchzuführen. Deshalb habe ich drush 10 für diese Drupal 8 Version installiert.

Als Hostingpartner nutze ich Host Europe mit dem Tarif oder Paket "WebServer Medium". Den Composer habe ich nach folgender Anleitung installiert: https://www.hosteurope.de/faq/webserver-dedicated/allgemeines-webserver/composer-installation/ und drush anhand folgender Anleitung: http://docs.drush.org/en/master/install/ als "site-local Drush".

In der Datei ".bash_profile" habe ich folgende Zeilen ergänzt:

alias composer='/usr/bin/php7.1 -d memory_limit=512M ~/bin/composer.phar'
alias drush='/usr/bin/php7.1 -d memory_limit=512M ~/.config/composer/vendor/drush/drush/drush'
export PATH="$HOME/.config/composer/vendor/bin:$PATH"

Die Installationen scheinen auch erfolgreich gewesen zu sein. Wenn ich z.B. "drush --version" eingebe, erhalte ich folgende Meldung:

Zitat:

Drush Commandline Tool 10.2.0

Als SSH bzw. Konsolen-Tool nutze ich übrigens "putty".

Migrationsprozess mit drush
Ich bin bei der Migration nach folgender Anleitung vorgegangen: https://www.drupal.org/docs/8/upgrade/upgrade-using-drush und habe folgendes eingegeben:
drush migrate-upgrade --legacy-db-url=mysql://user:password@server/db --legacy-root=http://example.com --configure-only
(Natürlich entsprechend durch die tatsächlichen Bezeichnungen/Werte für user, password, server, db und legacy-root ersetzt)

Der Befehl wirft jedes mal folgende Fehlermeldungen aus:

Zitat:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /is/htdocs/xxx/CMS/Drupal/xxx/drupal8/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php on line 83
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 32768 bytes) in /is/htdocs/xxx/CMS/Drupal/xxx/drupal8/vendor/symfony/http-foundation/Response.php on line 1

(also ca. 268 MB memory)

In der .htaccess Datei der Drupal 8 Installation habe ich (aus anderen Gründen zwar, aber vllt. hierfür auch relevant) folgende Zeilen ergänzt, die Änderungen an der php.ini vornehmen sollen:

<IfModule mod_php7.c>
    php_value upload_max_filesize 2000M
    php_value post_max_size 2000M
    php_value max_execution_time 3600
    php_value max_input_time 3600
    php_value max_input_vars 2500
</IfModule>

"phpinfo" bestätigt mir, dass das memory_limit tatsächlich auf "512M" gesetzt ist (local). Als master allerdings auf "256M".

Ich habe mich schon mit dem Webhoster in Verbindung gesetzt. Der hat den Fehler geprüft und ist der Meinung es sei kein serverseitiges Problem.
Da das memory_limit in der php.ini auf 512MB gesetzt ist, wissen sie nicht, warum dann diese Fehlermeldung auftaucht.

Nach weiterer Recherche habe ich herausgefunden, dass es 2 verschiendene php.ini gibt: Eine für CLI (command line interface) und eine für den Webserver.
drush verwendet logischerweise die CLI Variante.

Quellen:
https://www.drupaleasy.com/quicktips/hitting-drush-memory-limit
https://tutel.me/c/drupal/questions/253548/fatal+error+allowed+memory+size+of+x+size+when+running+drush+migrateupgrade

Gibt es eine Möglichkeit, wie ich an diese CLI php.ini rankomme und die Werte entsprechend anpasse?
Oder bin ich da auf dem Holzweg und der Hund liegt ganz wo anders begraben?

Danke schon mal im Voraus für eure Hilfe.

Grüße,
pyretta

PS: Ganz vergessen, in der "settings.php" habe ich auch noch folgendes ergänzt:

<?php


$databases
['default']['default'] = array (
 
'database' => 'dbxxxxxxxxxx-drupal8',
 
'username' => 'userxxxxxxx-d8',
 
'password' => 'xxxxxxxxxxx',
 
'prefix' => '',
 
'host' => 'wpxxxxxxxxxxx.server-he.de',
 
'port' => '3306',
 
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
 
'driver' => 'mysql',
);

$databases['upgrade']['default'] = array (
   
'database' => 'dbxxxxxxxxxx-drupal7',
   
'username' => 'userxxxxxxx-d7',
   
'password' => 'xxxxxxxxxxx',
   
'prefix' => '',
   
'host' => 'wpxxxxxxxxxxx.server-he.de',
   
'port' => '3306',
   
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
   
'driver' => 'mysql',
  );


?>

‹ Installation - Startseite wird nicht geladen [gelöst] drush 10.x - "migrate-upgrade" Befehl gibt Fehlermeldung aus: "Fatal error: Allowed memory size of XY bytes exhausted" ›
  • Anmelden oder Registrieren um Kommentare zu schreiben

pyretta schrieb[...]Gibt es

Eingetragen von pyretta (171)
am 31.01.2020 - 09:22 Uhr
pyretta schrieb

[...]
Gibt es eine Möglichkeit, wie ich an diese CLI php.ini rankomme und die Werte entsprechend anpasse?
[...]

Japp, hab ich gerade gefunden (und ich habe ja schon die ".bash_profile" Datei bearbeitet (s.o.) und somit - ohne es zu wissen (man lernt nie aus) - die php.ini für CLI angepasst): https://help.superhosting.bg/en/php-cli-settings-use-custom-ini.html

Werde ich gleich mal ausprobieren, ob das was bringt, wenn ich eine benutzerdefinierte php.ini einsetze. Möglich wäre ja, dass noch andere Parameter relevant sind und geändert werden müssen.

  • Anmelden oder Registrieren um Kommentare zu schreiben

Und ich hatte nun noch eine

Eingetragen von pyretta (171)
am 31.01.2020 - 09:55 Uhr

Und ich hatte nun noch eine Idee, die ich zuerst versucht hab: Ich hab doch ein "site-local drush" installiert - kein globales. In der .bash_profile Datei referenziere ich aber doch auf die globale drush Instanz (oder?) - also habe ich das wie folgt angepasst:

# alias drush='/usr/bin/php7.2 -d memory_limit=2048M ~/.config/composer/vendor/drush/drush/drush'
alias drush='/usr/bin/php7.2 -d memory_limit=2048M ~/CMS/Drupal/xxx/drupal8/vendor/bin/drush'

(also den bisherigen alias für drush auskommentiert und einen neuen hinzugefügt)

Dann erhalte ich ganz andere und viel wildere Fehlermeldungen - aber immerhin keine die auf ein memory-Limit hinweist:

Zitat:

[error] Error: Call to undefined function Drupal\migrate_upgrade\drush_print() in Drupal\migrate_upgrade\MigrateUpgradeDrushRunner->export() (line 311 of /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/modules/migrate_upgrade/src/MigrateUpgradeDrushRunner.php) #0 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/modules/migrate_upgrade/src/Commands/MigrateUpgradeCommands.php(61): Drupal\migrate_upgrade\MigrateUpgradeDrushRunner->export()
#1 [internal function]: Drupal\migrate_upgrade\Commands\MigrateUpgradeCommands->upgrade(Array)
#2 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#3 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#4 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/consolidation/annotated-command/src/CommandProcessor.php(178): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#5 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(302): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#6 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#13 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/drush/drush/drush(4): require('/is/htdocs/wp11...')
#14 {main}.
Error: Call to undefined function Drupal\migrate_upgrade\drush_print() in /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/modules/migrate_upgrade/src/MigrateUpgradeDrushRunner.php on line 311 #0 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/modules/migrate_upgrade/src/Commands/MigrateUpgradeCommands.php(61): Drupal\migrate_upgrade\MigrateUpgradeDrushRunner->export()
#1 [internal function]: Drupal\migrate_upgrade\Commands\MigrateUpgradeCommands->upgrade(Array)
#2 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#3 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#4 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/consolidation/annotated-command/src/CommandProcessor.php(178): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#5 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(302): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#6 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#13 /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/vendor/drush/drush/drush(4): require('/is/htdocs/wp11...')
#14 {main}
Error: Call to undefined function Drupal\migrate_upgrade\drush_print() in Drupal\migrate_upgrade\MigrateUpgradeDrushRunner->export() (line 311 of /is/htdocs/xxxx/CMS/Drupal/xxx/drupal8/modules/migrate_upgrade/src/MigrateUpgradeDrushRunner.php).
[warning] Drush command terminated abnormally.

Vielleicht hilft euch das weiter?

Zur Info (falls relevant):
Ich hab folgende Module installiert/aktiviert:

  • Field Group Migrate
  • Migrate
  • Migrate Drupal
  • Migrate Drupal Multilingual
  • Migrate Drupal UI
  • Migrate Plus
  • Migrate Tools
  • Drupal Upgrade
  • Anmelden oder Registrieren um Kommentare zu schreiben

So. Habe es nun endlich

Eingetragen von pyretta (171)
am 04.02.2020 - 16:41 Uhr

So. Habe es nun endlich hinbekommen. Es lag wohl daran, dass "Migrate_Upgrade" noch nicht komplett mit drush 10 kompatibel ist. Habe Drupal 8 nochmal parallel installiert und dort drush 9 ebenfalls als "site-local" installiert. Danach ging die Migration einfach von der Hand.

Also hier nochmal die Lösungsschritte zusammengefasst:

Ich hab folgende Module installiert/aktiviert:

  • Field Group Migrate
  • Migrate
  • Migrate Drupal
  • Migrate Drupal Multilingual
  • Migrate Drupal UI
  • Migrate Plus
  • Migrate Tools
  • Drupal Upgrade

In der Datei ".bash_profile" muss folgendes hinterlegt werden:

alias composer='/usr/bin/php7.2 -d memory_limit=2048M ~/bin/composer.phar'
alias drush='/usr/bin/php7.2 -d memory_limit=2048M ~/DRUPAL8-INSTALLATION/vendor/bin/drush'
export PATH="$HOME/.config/composer/vendor/bin:$PATH"

Bei der Installation von drush unbedingt die Versionsnummer "9" angeben:

composer global require drush/drush:9.x

drush-Befehle in der Shell immer im Verzeichnis "DRUPAL8-INSTALLATION/vendor/bin" ausführen.

drush Befehl zur Migration (Schritt 1):

drush migrate-upgrade --legacy-db-url=mysql://user:password@server/db --legacy-root=http://example.com --configure-only

Und noch ein Tipp: Nicht den Befehl "--all" verwenden, sondern jede Migration einzeln durchführen:

drush migrate-import <migration name>

Am besten mit allem was "User" im Namen beinhaltet anfangen.

So hat es bei mir geklappt. Hoffe, dass ich hiermit anderen geholfen habe, die vielleicht ähnliche Probleme haben.

  • Anmelden oder Registrieren um Kommentare zu schreiben

Benutzeranmeldung

  • Registrieren
  • Neues Passwort anfordern

Aktive Forenthemen

  • Medien und andere Daten mit Feeds von Drupal 7 auf Drupal 10 migrieren
  • für drupal11 ein Slider Modul
  • [gelöst] W3CSS Paragraphs Views
  • Drupal 11 neu aufsetzen und Bereiche aus 10 importieren
  • Wie erlaubt man neuen Benutzern auf die Resetseite zugreifen zu dürfen.
  • [gelöst] Anzeigeformat Text mit Bild in einem Artikel, Drupal 11
  • Social Media Buttons um Insteragram erweitern
  • Nach Installation der neuesten D10-Version kein Zugriff auf Website
  • Composer nach Umzug
  • [gelöst] Taxonomie Begriffe zeigt nicht alle Nodes an
  • Drupal 11 + Experience Builder (Canvas) + Layout Builder
  • Welche KI verwendet ihr?
Weiter

Neue Kommentare

  • Inzwischen sind wir bei
    vor 1 Woche 2 Tagen
  • Migrieren von D7 auf D8/ D10/ D11
    vor 1 Woche 3 Tagen
  • melde mich mal wieder, da ich
    vor 9 Wochen 10 Stunden
  • Hey danke
    vor 9 Wochen 1 Tag
  • Update: jetzt gibt's ein
    vor 9 Wochen 1 Tag
  • Hallo, im Prinzip habe ich
    vor 9 Wochen 6 Tagen
  • Da scheint die Terminologie
    vor 9 Wochen 6 Tagen
  • Kannst doch auch alles direkt
    vor 10 Wochen 3 Tagen
  • In der entsprechenden View
    vor 10 Wochen 3 Tagen
  • Dazu müsstest Du vermutlich
    vor 10 Wochen 3 Tagen

Statistik

Beiträge im Forum: 250235
Registrierte User: 20462

Neue User:

  • marouane.blel
  • capilclinic
  • Quabzibboter

» Alle User anzeigen

User nach Punkten sortiert:
wla9461
stBorchert6003
quiptime4972
Tobias Bähr4019
bv3924
ronald3857
md3717
Thoor3678
Alexander Langer3416
Exterior2903
» User nach Punkten
Zur Zeit sind 0 User und 20 Gäste online.

Hauptmenü

  • » Home
  • » Handbuch & FAQ
  • » Forum
  • » Übersetzungsserver
  • » Suche

Quicklinks I

  • Infos
  • Drupal Showcase
  • Installation
  • Update
  • Forum
  • Team
  • Verhaltensregeln

Quicklinks II

  • Drupal Jobs
  • FAQ
  • Drupal-Kochbuch
  • Best Practice - Drupal Sites - Guidelines
  • Drupal How To's

Quicklinks III

  • Tipps & Tricks
  • Drupal Theme System
  • Theme Handbuch
  • Leitfaden zur Entwicklung von Modulen

RSS & Twitter

  • Drupal Planet deutsch
  • RSS Feed News
  • RSS Feed Planet
  • Twitter Drupalcenter
Drupalcenter Team | Impressum & Datenschutz | Kontakt
Angetrieben von Drupal | Drupal is a registered trademark of Dries Buytaert.
Drupal Initiative - Drupal Association