# Fehler bei DB Import  foreign key constraint fails media\_folder\_configuration\_id

**URL:** https://forum.shopware.com/t/fehler-bei-db-import-foreign-key-constraint-fails-media-folder-configuration-id/61873
**Category:** Installation / Einstieg
**Created:** [19. September 2019 um 15:49 UTC](https://forum.shopware.com/t/fehler-bei-db-import-foreign-key-constraint-fails-media-folder-configuration-id/61873 "2019-09-19T15:49:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![derYak](https://avatars.discourse-cdn.com/v4/letter/d/b5ac83/32.png) [@derYak](https://forum.shopware.com/u/derYak)
#### Post date: [19. September 2019 um 15:49 UTC](https://forum.shopware.com/t/fehler-bei-db-import-foreign-key-constraint-fails-media-folder-configuration-id/61873/1 "2019-09-19T15:49:08Z")

</div>

Hallo zusammen,  
wahrscheinlich übersehe ich etwas offensichtliches aber ich komme partout nicht darauf.

Die Ausführung von “bin/setup” bzw. “./psh.phar install” schlägt reproduzierbar&nbsp;fehl.  
Ein erneutes herunterladen und ersetzen des gesamten Ordners hat genausowenig verändert wie das löschen der Datenbank.  
Ich hoffe jemand hat einen Ansatzpunkt und danke schoneinmal fürs Lesen.

Der Fehler (gekürzt):  
(7/37) Starting  
\> bin/console database:migrate --all Shopware\  
Migrated &nbsp; 125 from 137  
In MigrationCommand.php line 107:

&nbsp; &nbsp; Migration error: An exception occurred while executing ’  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; REPLACE INTO `media\_folder\_configuration\_media\_thumbnai &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; l\_size` (`media\_folder\_configuration\_id`, `media\_thumbnail\_size\_id`)  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VALUES (?, ?)  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ’ with params ["\xf4\x78\x10\xcc\x38\x3c\x46\x17\xbb\x1d\xf  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d\x9f\x47\x10\x36\x0a", “\xa3\x9f\xc5\xde\xb6\x76\x49\xc3\x84\xc1\xf5\x88\x  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 36\xe7\x65\xd7”]:

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; a child row: a foreign key constraint fails (`shopware`.`media\_folder\_confi &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; guration\_media\_thumbnail\_size`, CONSTRAINT `fk.media\_folder\_configuration\_m &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; edia\_thumbnail\_size.conf\_id` FOREIGN KEY (`media\_folder\_configuration\_id`)  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; REFERENCES `)

System:  
Windows 10  
VirtualBox Centos 7  
PHP 7.2.22  
mariadb &nbsp;Ver 15.1 Distrib 10.4.8-MariaDB

Update:  
Dies geschieht sowohl via CLI als auch via Webinstaller für das development template und die Installationszip.  
Das Webinterface zeigt alle Requirements&nbsp;grün und steigt an der gleichen Stelle aus.  
Es hat den Anschein als ob nur eine Zeile in der Tabelle&nbsp;media\_folder\_configuration angelegt wird und diese ID stimmt mit der&nbsp;media\_folder\_configuration\_id aus der Tabelle&nbsp;media\_folder für&nbsp;Theme Media überein. Gesucht werden als FK aber die IDs von&nbsp;Product Media,&nbsp;Category Media &&nbsp;Cms Page Media.  
Fällt jemandem ein Konfigurationsfehler ein?  
COLLATE=‘utf8mb4\_unicode\_ci’ & ENGINE=InnoDB für alle Tabellen.

---

<div class="post-metadata">

### Author: ![Michael\_Telgmann](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/michael_telgmann/32/20289_2.png) [@Michael\_Telgmann](https://forum.shopware.com/u/Michael_Telgmann)
#### Post date: [26. September 2019 um 06:05 UTC](https://forum.shopware.com/t/fehler-bei-db-import-foreign-key-constraint-fails-media-folder-configuration-id/61873/2 "2019-09-26T06:05:17Z")

</div>

Hallo,

wir werden den Fehler auf Github weiter behandeln.&nbsp;[Error in DB Migration · Issue #55 · shopware/development · GitHub](https://github.com/shopware/development/issues/55)

Viele Grüße aus Schöppingen

![cool](http://forum.shopware.com/plugins/CKEditor/plugins/smiley/images/shopware.png "cool")&nbsp;Michael Telgmann
