# Fehler beim Import Datenbank

**URL:** <https://forum.shopware.com/t/fehler-beim-import-datenbank/87596>\
**Category:** Shopware 6 (German)\
**Created:** [11. Mai 2021 um 11:09 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596 "2021-05-11T11:09:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ali.korkmaz](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@ali.korkmaz](https://forum.shopware.com/u/ali.korkmaz)\
**Post date:** [11. Mai 2021 um 11:09 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/1 "2021-05-11T11:09:29Z")

</div>

Hallo,  
Shopware 6 Installation bricht beim importieren von Datenbank (beim Schritt 130) ab.  
mit diesen Error.

woran könnte es liegen ?

Installation wird bei einem managed server durchgeführt.

## Error

Received an error message.  
**URL:** importDatabase  
**Message:**

Please try to fix this error and restart the update.

### Response

{„valid“:false,„errorMsg“:„An exception occurred while executing ‚ALTER TABLE `order` MODIFY COLUMN `language_id` BINARY(16) NOT NULL‘:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column ‚`c1shopwaredb`.`o`.`order_date_time`‘ in ‚GENERATED ALWAYS‘“}

danke

---

<div class="post-metadata">

**Author:** ![MStyle](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@MStyle](https://forum.shopware.com/u/MStyle)\
**Post date:** [11. Mai 2021 um 11:24 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/2 "2021-05-11T11:24:07Z")

</div>

Würde mich auch interessieren. Habe eben an der selben Stelle den Fehler bei der Installation erhalten:

## Error

Received an error message.  
**URL:** importDatabase  
**Message:**

Please try to fix this error and restart the update.

### Response

{„valid“:false,„errorMsg“:„An exception occurred while executing ‚ALTER TABLE `order` MODIFY COLUMN `language_id` BINARY(16) NOT NULL‘:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column ‚`DB`.`o`.`price`‘ in ‚CHECK‘“}

---

<div class="post-metadata">

**Author:** ![ali.korkmaz](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@ali.korkmaz](https://forum.shopware.com/u/ali.korkmaz)\
**Post date:** [11. Mai 2021 um 11:37 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/3 "2021-05-11T11:37:08Z")

</div>

Ich hatte SW6.4 am 08.05.2021 als test auf einen root server installiert. Es gab kein Problem.  
Wurde alles richtig installiert.

auch PHP 8.0  
server nginx

---

<div class="post-metadata">

**Author:** ![ali.korkmaz](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@ali.korkmaz](https://forum.shopware.com/u/ali.korkmaz)\
**Post date:** [11. Mai 2021 um 11:49 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/4 "2021-05-11T11:49:21Z")

</div>

wobei  
auf dem root server läuft mysql Community server  
auf dem managed server MariaDB

wenn man beim Managed server php version abfragt; Version: 8.0.5  
aber nginx läuft mit php7.3 auch php7-3.cli

hat es vieleicht damit was zutun ?

---

<div class="post-metadata">

**Author:** ![ali.korkmaz](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@ali.korkmaz](https://forum.shopware.com/u/ali.korkmaz)\
**Post date:** [11. Mai 2021 um 12:12 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/5 "2021-05-11T12:12:08Z")

</div>

ich habe jetzt noch mal geschaut

Voraussetzung für 6.4 ist php ab 7.4.3

welche php-fpm version hast du?

---

<div class="post-metadata">

**Author:** ![tarkka.ch](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/tarkka.ch/32/13452_2.png) [@tarkka.ch](https://forum.shopware.com/u/tarkka.ch)\
**Post date:** [11. Mai 2021 um 12:22 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/6 "2021-05-11T12:22:45Z")

</div>

Vielleicht einfach mal DB leeren und Installation neu beginnen.

---

<div class="post-metadata">

**Author:** ![ali.korkmaz](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@ali.korkmaz](https://forum.shopware.com/u/ali.korkmaz)\
**Post date:** [11. Mai 2021 um 12:26 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/7 "2021-05-11T12:26:46Z")

</div>

Ich habe schon, aber an selber Stelle bleibt stehen

---

<div class="post-metadata">

**Author:** ![MStyle](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@MStyle](https://forum.shopware.com/u/MStyle)\
**Post date:** [11. Mai 2021 um 12:52 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/8 "2021-05-11T12:52:19Z")

</div>

Ich glaub fast nicht das es an der PHP Version liegt. Habe es mit 7.4.18 und 8.0.5 versucht. DB habe ich MariaDB 10.4.19.

Eine bestehende Installation konnte ich mit den selben Einstellungen ohne Probleme updaten.

---

<div class="post-metadata">

**Author:** ![tarkka.ch](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/tarkka.ch/32/13452_2.png) [@tarkka.ch](https://forum.shopware.com/u/tarkka.ch)\
**Post date:** [11. Mai 2021 um 13:14 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/9 "2021-05-11T13:14:52Z")

</div>

Welche Version von Shopware installiert ihr?

Schon mal in der DB nachgesehen ob die Column „language\_id“ in der Tabelle „order“ vorhanden ist?

---

<div class="post-metadata">

**Author:** ![ali.korkmaz](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@ali.korkmaz](https://forum.shopware.com/u/ali.korkmaz)\
**Post date:** [11. Mai 2021 um 13:23 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/10 "2021-05-11T13:23:00Z")

</div>

ja vorhanden.

Ich habe bei bei den Installationen die Tabellen mir angeschaut.

Beim abgebrochenen sind weniger spalten da, aber das kann vielleicht wegen abgebrochenen Installation sein. Aber language\_id schon vorhanden.

beim abgebrochen Insatalliion

Field | Type | Null | Key | Default | Extra  
language\_id | binary(16) | YES | | NULL

beim ohne Fehler durchgeführte Installation auf dem root server:

Field | Type | Null | Key | Default | Extra  
language\_id | binary(16) | NO | MUL | NULL

Unterschied. NuLL und Key spalten

---

<div class="post-metadata">

**Author:** ![tarkka.ch](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/tarkka.ch/32/13452_2.png) [@tarkka.ch](https://forum.shopware.com/u/tarkka.ch)\
**Post date:** [11. Mai 2021 um 13:47 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/11 "2021-05-11T13:47:47Z")

</div>

Die error-logs geben auch nichts brauchbares aus?

---

<div class="post-metadata">

**Author:** ![ali.korkmaz](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@ali.korkmaz](https://forum.shopware.com/u/ali.korkmaz)\
**Post date:** [11. Mai 2021 um 15:37 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/12 "2021-05-11T15:37:58Z")

</div>

Ich habe kein Zugriff auf logs. Über PHPadmin kann ich nichts sehen

---

<div class="post-metadata">

**Author:** ![ali.korkmaz](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@ali.korkmaz](https://forum.shopware.com/u/ali.korkmaz)\
**Post date:** [11. Mai 2021 um 16:08 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/13 "2021-05-11T16:08:07Z")

</div>

ich denke, was nicht gefunden ist nicht language\_id.

:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column ‚`c1shopware`.`o`.`order_date_time`‘ in ‚GENERATED ALWAYS‘"}

meine Datenbankname : c1shopware

c1shopware.o. order\_date\_time

wenn das oben so zu verstehen ist:  
Datanbankname.Tabellenname.Column

es gibt kein Tabelle in Datenbank „o“

---

<div class="post-metadata">

**Author:** ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)\
**Post date:** [12. Mai 2021 um 07:15 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/14 "2021-05-12T07:15:24Z")

</div>

> [@ali.korkmaz](#):
>
> es gibt kein Tabelle in Datenbank „o“

Das ist nur eine Variable für die Tabelle „order“. Offensichtlich wurde beim Install die Spalte „order\_date\_time“ nicht angelegt. Könnte man zwar jetzt händisch machen, aber ich vermute das noch weitere Fehler bestehen.

---

<div class="post-metadata">

**Author:** ![ali.korkmaz](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@ali.korkmaz](https://forum.shopware.com/u/ali.korkmaz)\
**Post date:** [12. Mai 2021 um 08:17 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/15 "2021-05-12T08:17:33Z")

</div>

Spalte order\_data\_time ist schon vorhanden.

---

<div class="post-metadata">

**Author:** ![archery-analytics](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@archery-analytics](https://forum.shopware.com/u/archery-analytics)\
**Post date:** [12. Mai 2021 um 17:03 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/16 "2021-05-12T17:03:14Z")

</div>

Selbes Problem, die DB ist MariaDB 10.4 und PHP7.4.18. Habe dann versucht Shopware V6.3.5.4 und V6.3.5.3 komplett neu auf einem Testserver zu installieren und es kommt derselbe Fehler. Hat also wohl nichts mit 6.4.0.0 zu tun.

Hier das log:

```auto
 117/346 [=========âââââââââââââââââââ] 33%16:58:39 ERROR [app] Migration: "Shopware\Core\Migration\Migration1563805586AddLanguageToOrder" failed: "An exception occurred while executing 'ALTER TABLE `order` MODIFY COLUMN `language_id` BINARY(16) NOT NULL':

        SQLSTATE[42S22]: Column not found: 1054 Unknown column '`shopware`.`o`.`price`' in 'CHECK'"
         ---------- ----------------------
          Action Number of migrations
         ---------- ----------------------
          Migrated 130 out of 346
         ---------- ----------------------

        In MigrationCommand.php line 152:

          Migration error: An exception occurred while executing 'ALTER TABLE `order`
           MODIFY COLUMN `language_id` BINARY(16) NOT NULL':

          SQLSTATE[42S22]: Column not found: 1054 Unknown column '`shopware`.`o`.`pri
          ce`' in 'CHECK'
          Trace:
          #0 /var/www/html/sw6/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.p
          hp(166): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException()
          #1 /var/www/html/sw6/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.p
          hp(146): Doctrine\DBAL\DBALException::wrapException()
          #2 /var/www/html/sw6/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(
          1069): Doctrine\DBAL\DBALException::driverExceptionDuringQuery()
          #3 /var/www/html/sw6/vendor/shopware/platform/src/Core/Migration/Migration1
          563805586AddLanguageToOrder.php(30): Doctrine\DBAL\Connection->executeUpdat
          e()
          #4 /var/www/html/sw6/vendor/shopware/platform/src/Core/Framework/Migration/
          MigrationRuntime.php(47): Shopware\Core\Migration\Migration1563805586AddLan
          guageToOrder->update()
          #5 /var/www/html/sw6/vendor/shopware/platform/src/Core/Framework/Migration/
          Command/MigrationCommand.php(47): Shopware\Core\Framework\Migration\Migrati
          onRuntime->migrate()
          #6 /var/www/html/sw6/vendor/shopware/platform/src/Core/Framework/Migration/
          Command/MigrationCommand.php(145): Shopware\Core\Framework\Migration\Comman
          d\MigrationCommand->getMigrationGenerator()
          #7 /var/www/html/sw6/vendor/shopware/platform/src/Core/Framework/Migration/
          Command/MigrationCommand.php(99): Shopware\Core\Framework\Migration\Command
          \MigrationCommand->runMigrationForIdentifier()
          #8 /var/www/html/sw6/vendor/symfony/console/Command/Command.php(255): Shopw
          are\Core\Framework\Migration\Command\MigrationCommand->execute()
          #9 /var/www/html/sw6/vendor/symfony/console/Application.php(1027): Symfony\
          Component\Console\Command\Command->run()
          #10 /var/www/html/sw6/vendor/symfony/framework-bundle/Console/Application.p
          hp(97): Symfony\Component\Console\Application->doRunCommand()
          #11 /var/www/html/sw6/vendor/symfony/console/Application.php(273): Symfony\
          Bundle\FrameworkBundle\Console\Application->doRunCommand()
          #12 /var/www/html/sw6/vendor/symfony/framework-bundle/Console/Application.p
          hp(83): Symfony\Component\Console\Application->doRun()
          #13 /var/www/html/sw6/vendor/symfony/console/Application.php(149): Symfony\
          Bundle\FrameworkBundle\Console\Application->doRun()
          #14 /var/www/html/sw6/bin/console(48): Symfony\Component\Console\Applicatio
          n->run()
          #15 {main}

        In AbstractMySQLDriver.php line 60:

          An exception occurred while executing 'ALTER TABLE `order` MODIFY COLUMN `l
          anguage_id` BINARY(16) NOT NULL':

          SQLSTATE[42S22]: Column not found: 1054 Unknown column '`shopware`.`o`.`pri
          ce`' in 'CHECK'

        In PDOConnection.php line 43:

          SQLSTATE[42S22]: Column not found: 1054 Unknown column '`shopware`.`o`.`pri
          ce`' in 'CHECK'

        In PDOConnection.php line 41:

          SQLSTATE[42S22]: Column not found: 1054 Unknown column '`shopware`.`o`.`pri
          ce`' in 'CHECK'

        database:migrate [-all|--all] [-u|--until [UNTIL]] [-l|--limit [LIMIT]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<identifier>...]

Execution aborted, a subcommand failed!

```

Hier noch das migration script das den Fehler verursacht:

```auto
<?php declare(strict_types=1);

namespace Shopware\Core\Migration;

use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Migration\MigrationStep;

class Migration1563805586AddLanguageToOrder extends MigrationStep
{
    public function getCreationTimestamp(): int
    {
        return 1563805586;
    }

    public function update(Connection $connection): void
    {
        $connection->executeUpdate('ALTER TABLE `order` ADD `language_id` BINARY(16) AFTER `currency_id`');

        $connection->executeUpdate(
            'UPDATE `order` AS `o` SET `o`.`language_id` = COALESCE((
                SELECT `language_id` FROM `customer` AS `c`
                    LEFT JOIN `order_customer` AS `oc`
                        ON `c`.`id` = `oc`.`customer_id` WHERE `oc`.`order_id` = `o`.`id` LIMIT 1
            ), (SELECT `id` FROM `language` AS `l`
                    LEFT JOIN `sales_channel_language` AS `scl`
                        ON `l`.`id` = `scl`.`language_id` WHERE `scl`.`sales_channel_id` = `o`.`sales_channel_id` LIMIT 1
            ))'
        );

        $connection->executeUpdate('ALTER TABLE `order` MODIFY COLUMN `language_id` BINARY(16) NOT NULL');

        $connection->executeUpdate('ALTER TABLE `order` ADD CONSTRAINT `fk.language_id` FOREIGN KEY (`language_id`)
              REFERENCES `language` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE');
    }

    public function updateDestructive(Connection $connection): void
    {
    }
}

```

Kann da jemand was erkennen?

EDIT: Der Fehler kommt auch, wenn man direkt in der mysql console den Befehl  
`ALTER TABLE 'order' MODIFY COLUMN 'language_id' BINARY(16) NOT NULL;`  
ausführt.

---

<div class="post-metadata">

**Author:** ![Feggel](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/feggel/32/13471_2.png) [@Feggel](https://forum.shopware.com/u/Feggel)\
**Post date:** [12. Mai 2021 um 17:27 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/17 "2021-05-12T17:27:28Z")

</div>

Ich habe genau das gleiche Problem mit einer Neuinstallation. Mehrfach mit verschiedenen PHP- und MariaDB-Versionen ausprobiert.

Der Installationsvorgang bricht bei Heft 130 mit dem folgenden Fehler ab:

## Error

Received an error message.  
**URL:** importDatabase  
**Message:**

Please try to fix this error and restart the update.

### Response

{„valid“:false,„errorMsg“:„An exception occurred while executing ‚ALTER TABLE `order` MODIFY COLUMN `language_id` BINARY(16) NOT NULL‘:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column ‚`gyhyxatfjk`.`o`.`order_date_time`‘ in ‚GENERATED ALWAYS‘“}

---

<div class="post-metadata">

**Author:** ![ali.korkmaz](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@ali.korkmaz](https://forum.shopware.com/u/ali.korkmaz)\
**Post date:** [12. Mai 2021 um 19:17 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/19 "2021-05-12T19:17:35Z")

</div>

bei mir mit cli installation kann nicht gestartet werden,

bricht sofort app.

Connection Fehler

---

<div class="post-metadata">

**Author:** ![cdweb-net](https://avatars.discourse-cdn.com/v4/letter/c/439d5e/32.png) [@cdweb-net](https://forum.shopware.com/u/cdweb-net)\
**Post date:** [12. Mai 2021 um 19:22 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/20 "2021-05-12T19:22:15Z")

</div>

Ich habe dasselbe Problem, habe auch schon andere Shopware 6 Versionen ausprobiert. Ist überall das gleiche.  
Habe auch schon verschiedene Berechtigungen der MySQL User Versucht sowie die Datenbank gelöscht neu angelegt usw. Die Anforderungen werden erfüllt.

---

<div class="post-metadata">

**Author:** ![ali.korkmaz](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@ali.korkmaz](https://forum.shopware.com/u/ali.korkmaz)\
**Post date:** [12. Mai 2021 um 19:42 UTC](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596/21 "2021-05-12T19:42:16Z")

</div>

mit cli habe ich Fehler

SQLSTATE[HY000] [2002]

es soll bedeuten :

In simple terms, MySQL error 2002 denotes a problem of connection between the website code and the database.

> **[SQLSTATE hy000 error 2002 \[Solved\]](https://bobcares.com/blog/sqlstate-hy000-error-2002/)**
>
> The major reasons for sqlstate hy000 error 2002 include stopped MySQL server, insufficient server resources, incorrect database settings, etc.

[Nächste Seite](https://forum.shopware.com/t/fehler-beim-import-datenbank/87596.md?page=2)
