# Fehlermeldung Datenbank einspielen aus Datensicherung

**URL:** <https://forum.shopware.com/t/fehlermeldung-datenbank-einspielen-aus-datensicherung/101082>\
**Category:** Installation / Einstieg\
**Created:** [30. August 2023 um 11:48 UTC](https://forum.shopware.com/t/fehlermeldung-datenbank-einspielen-aus-datensicherung/101082 "2023-08-30T11:48:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuergenS](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@JuergenS](https://forum.shopware.com/u/JuergenS)\
**Post date:** [30. August 2023 um 11:48 UTC](https://forum.shopware.com/t/fehlermeldung-datenbank-einspielen-aus-datensicherung/101082/1 "2023-08-30T11:48:08Z")

</div>

Hallo zusammen,  
ich wollte gerade eine Datensicherung einspielen und bekomme folgende Fehlermeldung:  
`Function or expression 'variant_listing_config' cannot be used in the CHECK clause of `variant\_listing\_config``

Der Fehler tritt an der Stelle auf:

```auto
  `variant_listing_config` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin GENERATED ALWAYS AS (case when `display_parent` is not null or `main_variant_id` is not null or `configurator_group_config` is not null then json_object('displayParent',`display_parent`,'mainVariantId',lcase(hex(`main_variant_id`)),'configuratorGroupConfig',json_extract(`configurator_group_config`,'$')) end) VIRTUAL CHECK (json_valid(`variant_listing_config`)),

```

Der Shop ist auf [all-inkl.com](http://all-inkl.com), dort laufen die Datenbanken mit mariadb.  
Kann ich die Bedingung zum Einspielen weglassen und nachträglich einfügen?

---

<div class="post-metadata">

**Author:** ![j.jonas](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@j.jonas](https://forum.shopware.com/u/j.jonas)\
**Post date:** [5. September 2023 um 09:07 UTC](https://forum.shopware.com/t/fehlermeldung-datenbank-einspielen-aus-datensicherung/101082/2 "2023-09-05T09:07:04Z")

</div>

Ich habe hier das gleiche Problem in der Version 6.4.19.0

Es scheint so als ob du das

```auto
CHECK (json_valid(`variant_listing_config`))

```

am Ende einfach weglassen kannst. Danach solltest du den Dump wieder einspielen können.  
Die Zeile sollte dann so aussehen:

```auto
`variant_listing_config` longtext CHARACTER SET utf8mb4 GENERATED ALWAYS AS (case when `display_parent` is not null or `main_variant_id` is not null or `configurator_group_config` is not null then json_object('displayParent',`display_parent`,'mainVariantId',lcase(hex(`main_variant_id`)),'configuratorGroupConfig',json_extract(`configurator_group_config`,'$')) end) VIRTUAL,

```

---

<div class="post-metadata">

**Author:** ![falko.linke](https://avatars.discourse-cdn.com/v4/letter/f/53a042/32.png) [@falko.linke](https://forum.shopware.com/u/falko.linke)\
**Post date:** [5. September 2023 um 09:24 UTC](https://forum.shopware.com/t/fehlermeldung-datenbank-einspielen-aus-datensicherung/101082/3 "2023-09-05T09:24:01Z")

</div>

Hallo,  
ich hatte dasselbe Problem. Ich konnte es lösen indem ich die Server MariaDB Version mit der Lokalen Version angeglichen habe. Auf dem Server lief 10.6.10 Lokal 10.6. Nach dem erhöhen der lokalen Version auf 10.6.10 lief der Import wieder.

---

<div class="post-metadata">

**Author:** ![rcdemr](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/rcdemr/32/24684_2.png) [@rcdemr](https://forum.shopware.com/u/rcdemr)\
**Post date:** [6. Oktober 2023 um 07:49 UTC](https://forum.shopware.com/t/fehlermeldung-datenbank-einspielen-aus-datensicherung/101082/4 "2023-10-06T07:49:11Z")

</div>

Hallo J.Jonas,

vielen Dank für Deine Nachricht. Wir haben hier gerade das selbe Problem.

Wie meinst du das mit weglassen? Wo lasse ich diese Zeile weg bzw. ändere sie?

Vielen Dank.

Schöne Grüße,  
Matthias Rau

---

<div class="post-metadata">

**Author:** ![JuergenS](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@JuergenS](https://forum.shopware.com/u/JuergenS)\
**Post date:** [6. Oktober 2023 um 09:13 UTC](https://forum.shopware.com/t/fehlermeldung-datenbank-einspielen-aus-datensicherung/101082/5 "2023-10-06T09:13:57Z")

</div>

Zunächst mal noch Danke an j.jonas und falko.linke für die Info.  
Ich habe bei meinem Provider einen anderen Vertrag abgeschlossen, mit der aktuellen Maria DB Version.  
@rcdemr wenn du deine Datenbank zurückspielst in der Tabelle „product“ die Definition für die Spalte „variant\_listing\_config“ lässt du dan den Bereich

> GENERATED ALWAYS AS (case when `display_parent` is not null or `main_variant_id` is not null or `configurator_group_config` is not null then json\_object(‚displayParent‘,`display_parent`,‚mainVariantId‘,lcase(hex(`main_variant_id`)),‚configuratorGroupConfig‘,json\_extract(`configurator_group_config`)) end) VIRTUAL

weg.  
Dann sollte es klappen.  
Gruß Jürgen

---

<div class="post-metadata">

**Author:** ![j.jonas](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@j.jonas](https://forum.shopware.com/u/j.jonas)\
**Post date:** [9. Oktober 2023 um 08:27 UTC](https://forum.shopware.com/t/fehlermeldung-datenbank-einspielen-aus-datensicherung/101082/6 "2023-10-09T08:27:09Z")

</div>

Hallo Matthias,

in deinem Dump findest du irgendwo die Stelle, an der die product Tabelle erstellt wird. Die Stelle fängt mit „CREATE TABLE `product` (“ an. Dort wird die Spalte „variant\_listing\_config“ definiert. Bei mir steht dort:

```auto
  `variant_listing_config` longtext CHARACTER SET utf8mb4 GENERATED ALWAYS AS (case when `display_parent` is not null or `main_variant_id` is not null or `configurator_group_config` is not null then json_object('displayParent',`display_parent`,'mainVariantId',lcase(hex(`main_variant_id`)),'configuratorGroupConfig',json_extract(`configurator_group_config`,'$')) end) VIRTUAL CHECK (json_valid(`variant_listing_config`)),

```

und das " CHECK (json\_valid(`variant_listing_config`))" am Ende macht Probleme. Das kann aber auch einfach weg, so dass die Zeile dann so aussieht:

```auto
`variant_listing_config` longtext CHARACTER SET utf8mb4 GENERATED ALWAYS AS (case when `display_parent` is not null or `main_variant_id` is not null or `configurator_group_config` is not null then json_object('displayParent',`display_parent`,'mainVariantId',lcase(hex(`main_variant_id`)),'configuratorGroupConfig',json_extract(`configurator_group_config`,'$')) end) VIRTUAL,

```

Ich habe dafür den Dump in notepad++ geöffnet und es dort bearbeitet, geht aber auch mit jedem anderen Text-Programm.

Viele Grüße,  
Jens

---

<div class="post-metadata">

**Author:** ![sebastian.morgenster](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@sebastian.morgenster](https://forum.shopware.com/u/sebastian.morgenster)\
**Post date:** [25. Oktober 2023 um 13:38 UTC](https://forum.shopware.com/t/fehlermeldung-datenbank-einspielen-aus-datensicherung/101082/7 "2023-10-25T13:38:13Z")

</div>

In der Version 6.5 gibt es eine Migration die das Problem für bestehende Installationen korrigiert:

> <https://github.com/shopware/shopware/blob/v6.5.6.0/src/Core/Migration/V6_5/Migration1678197291ConvertVariantListingConfig.php>

Diese kann auch für die 6.4 genommen werden

---

<div class="post-metadata">

**Author:** ![ccsgmbh1](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@ccsgmbh1](https://forum.shopware.com/u/ccsgmbh1)\
**Post date:** [13. Februar 2024 um 17:40 UTC](https://forum.shopware.com/t/fehlermeldung-datenbank-einspielen-aus-datensicherung/101082/8 "2024-02-13T17:40:40Z")

</div>

hallo ich weiß, das ist schon etwas älter, aber wir haben heute die gleiche Fehlermeldung erhalten beim UpGrade aus dem Backend von SW 6.4.12 → 6.4.20. Wir haben auch Maria DB 10.11.7 (lt. phpmy admin)

```auto
CHECK (json_valid(`variant_listing_config`))

```

könnte vmtl. die Lösung sein, nur frage mich an welcher Stelle ich da eingreifen kann, ich habe ja keinen dump. Der Backend UpDater läuft ja einfach bis zu besagter Fehlermeldung durch.

---

<div class="post-metadata">

**Author:** ![Adelbert](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@Adelbert](https://forum.shopware.com/u/Adelbert)\
**Post date:** [21. Februar 2024 um 14:03 UTC](https://forum.shopware.com/t/fehlermeldung-datenbank-einspielen-aus-datensicherung/101082/9 "2024-02-21T14:03:10Z")

</div>

Habe das gleiche Problem, bei einer Installation von 6.4.20. Maria DB 10.5.23 ist installiert. Konntest du es lösen? Bzw. wie kann ich den Teil, der für den Fehler sorgt, weglassen, wenn ich einfach nur Shopware 6.4.20 installieren will?

---

<div class="post-metadata">

**Author:** ![ccsgmbh1](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@ccsgmbh1](https://forum.shopware.com/u/ccsgmbh1)\
**Post date:** [21. Februar 2024 um 18:17 UTC](https://forum.shopware.com/t/fehlermeldung-datenbank-einspielen-aus-datensicherung/101082/10 "2024-02-21T18:17:30Z")

</div>

hallo Adelbert, gelöst ist es mittlerweile, aber nicht so wie man annehmen könnte. Wir sind auf Maria DB 10.11 bei einem anderen Provider gewechselt, da kamen dann aber auch wieder ganz andere Fehlermeldungen. Einfach nur wirr dieses 6.4.20 Upgrade.  
Wir sind dann direkt auf SW 6.5.8.5 gegangen, mit dem .phar Installer. Vorher alle PlugIns, deaktviveren und aufpassen dass php 8.1 läuft, bei 8.3 ging es nämlich nicht. Obwohl sich ein neuer Shop schon mit php 8.3 installieren läßt.  
Noch Fragen !?

---

<div class="post-metadata">

**Author:** ![MichaelH74](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/michaelh74/32/10014_2.png) [@MichaelH74](https://forum.shopware.com/u/MichaelH74)\
**Post date:** [23. März 2024 um 17:06 UTC](https://forum.shopware.com/t/fehlermeldung-datenbank-einspielen-aus-datensicherung/101082/11 "2024-03-23T17:06:39Z")

</div>

Hatte das Problem beim Update von einer 6.4.18.x auf 6.4.20.x.

Der Workaround, der in der DB-Migration in neuen 6.5.x Versionen enthalten ist kann auch händisch per SQL z.B. im phpMyAdmin ausgeführt werden. Danach läuft das durch, da in der Problem Migration, geprüft wird, ob das Feld schon da ist und falls, ja wird das SQL Statement nicht ausgeführt.

Die Steps sind hier gut aufgeführt:

> **[Shopware 6.5 - Function or Expression 'variant\_listing\_config' cannot be used...](https://help.creoline.com/doc/shopware-65-function-or-expression-variant_listing_config-cannot-be-used-in-the-check-clause-Dgbg2nAJTX)**
>
> Fehlermeldung
> Beim Shopware Update von der Version 6.4 auf 6.5 entsteht folgende Fehlermeldung:
> SQLSTATE\[HY000\]: 
> General error: 1901 
> Function or expression 'variant\_listing\_config' cannot be used in the CHECK clause of...
