# SW6 Installationsfehler beim Import der Datenbank

**URL:** https://forum.shopware.com/t/sw6-installationsfehler-beim-import-der-datenbank/60556
**Category:** Installation / Einstieg
**Created:** [20. Juli 2019 um 11:32 UTC](https://forum.shopware.com/t/sw6-installationsfehler-beim-import-der-datenbank/60556 "2019-07-20T11:32:53Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![KEOW](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/keow/32/27850_2.png) [@KEOW](https://forum.shopware.com/u/KEOW)
#### Post date: [20. Juli 2019 um 11:32 UTC](https://forum.shopware.com/t/sw6-installationsfehler-beim-import-der-datenbank/60556/1 "2019-07-20T11:32:53Z")

</div>

Hallo zusammen,

beim versuch eine Test-Installation von SW6 auf meinen Host einzurichten, kommt es beim Importieren der Datenbank zu nachfolgenden Feler:&nbsp;

&nbsp;

```
Error
Received an error message.
URL: importDatabase
Message: Internal Server Error

Please try to fix this error and restart the update.
Response
{"valid":false,"errorMsg":"An exception occurred while executing '\n CREATE TABLE `custom_field` (\n `id` BINARY(16) NOT NULL PRIMARY KEY,\n `name` VARCHAR(255) NOT NULL,\n `type` VARCHAR(255) NOT NULL,\n `config` JSON NULL,\n `active` TINYINT(1) NOT NULL DEFAULT 1,\n `set_id` BINARY(16) NULL,\n `created_at` DATETIME(3) NOT NULL,\n `updated_at` DATETIME(3) NULL,\n CONSTRAINT `uniq.custom_field.name` UNIQUE (`name`),\n CONSTRAINT `json.custom_field.config` CHECK(JSON_VALID(`config`)),\n CONSTRAINT `fk.custom_field.set_id` FOREIGN KEY (set_id)\n REFERENCES `custom_field_set` (id) ON UPDATE CASCADE ON DELETE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;\n ':\n\nSQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint"}

```

Dieser Fehler tritt im “Datenbank Installation: Schritt&nbsp;70&nbsp;von&nbsp;250” auf.

Laut System erfülle ich alle&nbsp;Systemvoraussetzungen.

MySQL Version: 5.7  
PHP Version: 7.3.5

&nbsp;

&nbsp;

Wie bekomm ich das nun zum laufen? Lokal bekomme ich es nämlich ebenfalls (jedoch aus anderen Gründen) nicht zum laufen.

---

<div class="post-metadata">

### Author: ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)
#### Post date: [20. Juli 2019 um 12:17 UTC](https://forum.shopware.com/t/sw6-installationsfehler-beim-import-der-datenbank/60556/2 "2019-07-20T12:17:09Z")

</div>

[https://issues.shopware.com/issues/NEXT-4072?\_ga=2.42973349.1256526625.1562875771-2035421451.1562254622](https://issues.shopware.com/issues/NEXT-4072?_ga=2.42973349.1256526625.1562875771-2035421451.1562254622)

könnte damit zusammenhängen&nbsp;

---

<div class="post-metadata">

### Author: ![gerdkunze](https://avatars.discourse-cdn.com/v4/letter/g/cdc98d/32.png) [@gerdkunze](https://forum.shopware.com/u/gerdkunze)
#### Post date: [20. Juli 2019 um 14:48 UTC](https://forum.shopware.com/t/sw6-installationsfehler-beim-import-der-datenbank/60556/3 "2019-07-20T14:48:01Z")

</div>

hilft nicht weiter

&nbsp;

```
 &nbsp;

```

**Type:** Doctrine\DBAL\DBALException

**Message:** An exception occurred while executing 'INSERT IGNORE INTO migration (`class`, `creation_timestamp`) VALUES (‘Shopware\Core\Migration\Migration1536232600Language’,‘1536232600’), (‘Shopware\Core\Migration\Migration1536232610Locale’,‘1536232610’), (‘Shopware\Core\Migration\Migration1536232620SalesChannelType’,‘1536232620’), (‘Shopware\Core\Migration\Migration1536232630PropertyGroup’,‘1536232630’), (‘Shopware\Core\Migration\Migration1536232640Currency’,‘1536232640’), (‘Shopware\Core\Migration\Migration1536232650CustomerGroup’,‘1536232650’),

…

Migration\Migration1536233090MediaThumbnail’,‘1536233090’), (‘Shopware\Core\Migration\Migration1536233100PropertyGroupOption’,‘1536233100’), (‘Shopware\Core\Migration\Migration1536233110ProductManufacturer’,‘1536233110’), (‘Shopware\Core\Migration\Migration1536233120Product’,‘1536233120’), (‘Shopware\Core\Migration\Migration1536233130ProductMedia’,‘1536233130’), (‘Shopware\Core\Migration\Migration1536233140ProductProperty’,‘1536233140’), (‘Shopware\Core\Migration\Migration1536233150ProductOption’,‘1536233150’), (‘Shopware\Core\Migration\Migration1536233160ProductConfigurator’,‘1536233160’), (‘Shopware\Core\Migration\Migration1536233170ProductCategoryTree’,‘1536233170’), (‘Shopware\Core\Migration\Migration1536233180ProductCategory’,‘1536233180’), (‘Shopware\Core\Migration\Migration1536233190ProductPriceRule’,‘1536233190’), (‘Shopware\Core\Migration\Migration1536233200RuleCondition’,‘1536233200’), (‘Shopware\Core\Migration\Migration1536233210SalesChannelDomain’,‘1536233210’), (‘Shopware\Core\Migration\Migration1536233220PluginTranslation’,‘1536233220’), (‘Shopware\Core\Migration\Migration1536233230ProductStream’,‘1536233230’), (‘Shopware\Core\Migration\Migration1536233240ProductStreamFilter’,‘1536233240’), (‘Shopware\Core\Migration\Migration1536233250MessageQueueStats’,‘1536233250’), (‘Shopware\Core\Migration\Migration1536233260StateMachineHistory’,‘1536233260’), (‘Shopware\Core\Migration\Migration1536233270SystemConfig’,‘1536233270’), (‘Shopware\Core\Migration\Migration1536233280CustomFieldSet’,‘1536233280’), (‘Shopware\Core\Migration\Migration1536233290CustomFieldSetRelation’,‘1536233290’), (‘Shopware\Core\Migration\Migration1536233300CustomField’,‘1536233300’), (‘Shopware\Core\Migration\Migration1536233310ScheduledTask’,‘1536233310’), (‘Shopware\Core\Migration\Migration1536233320DeadMessage’,‘1536233320’), (‘Shopware\Core\Migration\Migration1536233330MailTemplate’,‘1536233330’), (‘Shopware\Core\Migration\Migration1536233340NumberRange’,‘1536233340’), (‘Shopware\Core\Migration\Migration1536233350ProductVisibility’,‘1536233350’), (‘Shopware\Core\Migration\Migration1536233360Document’,‘1536233360’), (‘Shopware\Core\Migration\Migration1536233370EventAction’,‘1536233370’), (‘Shopware\Core\Migration\Migration1536233380UserRecovery’,‘1536233380’), (‘Shopware\Core\Migration\Migration1536233390Promotion’,‘1536233390’), (‘Shopware\Core\Migration\Migration1536233400MailTemplateMedia’,‘1536233400’), (‘Shopware\Core\Migration\Migration1536233410PromotionSalesChannel’,‘1536233410’), (‘Shopware\Core\Migration\Migration1536233420PromotionDiscount’,‘1536233420’), (‘Shopware\Core\Migration\Migration1536233430NewsletterRecipient’,‘1536233430’), (‘Shopware\Core\Migration\Migration1536233440PromotionPersonaCustomer’,‘1536233440’), (‘Shopware\Core\Migration\Migration1536233450PromotionPersonaRules’,‘1536233450’), (‘Shopware\Core\Migration\Migration1536233460NumberRangeTranslationAndConfiguration’,‘1536233460’), (‘Shopware\Core\Migration\Migration1536233470PromotionOrderRule’,‘1536233470’), (‘Shopware\Core\Migration\Migration1536233480SalesChannelApiContext’,‘1536233480’), (‘Shopware\Core\Migration\Migration1536233500PromotionDiscountRule’,‘1536233500’), (‘Shopware\Core\Migration\Migration1536233510DocumentConfiguration’,‘1536233510’), (‘Shopware\Core\Migration\Migration1536233520PromotionCartRule’,‘1536233520’), (‘Shopware\Core\Migration\Migration1536233530SalesChannelCategoryId’,‘1536233530’), (‘Shopware\Core\Migration\Migration1536233540ProductSearchKeyword’,‘1536233540’), (‘Shopware\Core\Migration\Migration1536233550Tag’,‘1536233550’), (‘Shopware\Core\Migration\Migration1536233560BasicData’,‘1536233560’), (‘Shopware\Core\Migration\Migration1552360944MediaFolderConfigurationNoAssoc’,‘1552360944’), (‘Shopware\Core\Migration\Migration1554199340AddImportExportProfile’,‘1554199340’), (‘Shopware\Core\Migration\Migration1554200141ImportExportFile’,‘1554200141’), (‘Shopware\Core\Migration\Migration1554203706AddImportExportLog’,‘1554203706’), (‘Shopware\Core\Migration\Migration1558082916AddBreadcrumb’,‘1558082916’), (‘Shopware\Core\Migration\Migration1558105657CurrencyPrices’,‘1558105657’), (‘Shopware\Core\Migration\Migration1558443337PromotionSalesChannel’,‘1558443337’), (‘Shopware\Core\Migration\Migration1558505525Logging’,‘1558505525’), (‘Shopware\Core\Migration\Migration1558594334PromotionDiscountPrice’,‘1558594334’), (‘Shopware\Core\Migration\Migration1558938938ChangeGroupSortingColumn’,‘1558938938’), (‘Shopware\Core\Migration\Migration1559050088Promotion’,‘1559050088’), (‘Shopware\Core\Migration\Migration1559050903PromotionExclusion’,‘1559050903’), (‘Shopware\Core\Migration\Migration1561370284AddImportExportProductProfile’,‘1561370284’), (‘Shopware\Core\Migration\Migration1561377793AddAvailableAsShippingCountry’,‘1561377793’), (‘Shopware\Core\Migration\Migration1561442979ElasticsearchIndexTask’,‘1561442979’), (‘Shopware\Core\Migration\Migration1561452005Update’,‘1561452005’), (‘Shopware\Core\Migration\Migration1561712450NewSystemConfigsAndDefaultValues’,‘1561712450’), (‘Shopware\Core\Migration\Migration1562228335SetConfigDefaults’,‘1562228335’), (‘Shopware\Core\Migration\Migration1562240231UserPasswordRecovery’,‘1562240231’), (‘Shopware\Core\Migration\Migration1562306893MakeCustomerFirstLoginDateTime’,‘1562306893’), (‘Shopware\Core\Migration\Migration1562324772AddOrderDateToOrder’,‘1562324772’), (‘Shopware\Core\Migration\Migration1562579120ProductAvailableFields’,‘1562579120’), (‘Shopware\Core\Migration\Migration1562684474AddDeliveryTime’,‘1562684474’), (‘Shopware\Core\Migration\Migration1562841035AddProductChildCount’,‘1562841035’), (‘Shopware\Core\Migration\Migration1562933907ContactForm’,‘1562933907’), (‘Shopware\Core\Migration\Migration1563180880AddDefaultThumbnailSizes’,‘1563180880’);’: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘fit\_sw6.migration’ doesn’t exist

**File:** /var/www/vhosts/xxxxxxxxxxxxxxxxxxxxxxxx/public/recovery/common/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php

**Line:** 172

Trace

---

<div class="post-metadata">

### Author: ![H2O](https://avatars.discourse-cdn.com/v4/letter/h/35a633/32.png) [@H2O](https://forum.shopware.com/u/H2O)
#### Post date: [20. Juli 2019 um 14:51 UTC](https://forum.shopware.com/t/sw6-installationsfehler-beim-import-der-datenbank/60556/4 "2019-07-20T14:51:43Z")

</div>

Same Problem =(

---

<div class="post-metadata">

### Author: ![shyim](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/shyim/32/7681_2.png) [@shyim](https://forum.shopware.com/u/shyim)
#### Post date: [20. Juli 2019 um 15:43 UTC](https://forum.shopware.com/t/sw6-installationsfehler-beim-import-der-datenbank/60556/5 "2019-07-20T15:43:47Z")

</div>

Wenn die Tabelle nicht existiert liegt es meist an der MariaDB version

---

<div class="post-metadata">

### Author: ![mbdesign](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/mbdesign/32/14160_2.png) [@mbdesign](https://forum.shopware.com/u/mbdesign)
#### Post date: [23. Juli 2019 um 22:24 UTC](https://forum.shopware.com/t/sw6-installationsfehler-beim-import-der-datenbank/60556/6 "2019-07-23T22:24:11Z")

</div>

Danke für den Hinweis, d.h. welche Maria DB Version wird benötigt?

---

<div class="post-metadata">

### Author: ![kulli](https://avatars.discourse-cdn.com/v4/letter/k/a3d4f5/32.png) [@kulli](https://forum.shopware.com/u/kulli)
#### Post date: [24. Juli 2019 um 03:24 UTC](https://forum.shopware.com/t/sw6-installationsfehler-beim-import-der-datenbank/60556/7 "2019-07-24T03:24:29Z")

</div>

mind. 10.3.x

---

<div class="post-metadata">

### Author: ![dogado\_shops](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@dogado\_shops](https://forum.shopware.com/u/dogado_shops)
#### Post date: [24. Juli 2019 um 21:32 UTC](https://forum.shopware.com/t/sw6-installationsfehler-beim-import-der-datenbank/60556/8 "2019-07-24T21:32:27Z")

</div>

Hi,

Ihr benötigt MySQL 5.7 oder das performantere MariaDB 10.3 - falls Ihr einen vServer / Dedi bei uns habt und mind. Shopware 5.5.x einsetzt, könnt Ihr Euch gerne im Support melden - die Instanzen werden kostenlos auf MariaDB 10.3 umgestellt. Im einfachen Shared Hosting sind die Shopware 6 / 5.6 Voraussetzungen bereits umgesetzt.

VG

&nbsp;

---

<div class="post-metadata">

### Author: ![filzrausch](https://avatars.discourse-cdn.com/v4/letter/f/ee7513/32.png) [@filzrausch](https://forum.shopware.com/u/filzrausch)
#### Post date: [21. August 2019 um 09:56 UTC](https://forum.shopware.com/t/sw6-installationsfehler-beim-import-der-datenbank/60556/9 "2019-08-21T09:56:40Z")

</div>

**EDIT solved for me: Hoster All-inkl**

Solution: [Shopware Issuetracker](https://issues.shopware.com/issues/NEXT-4072?_ga=2.161850811.646246316.1566207031-1434956727.1545129863)

Mysql 5.7.26-nmm1-log - (Ubuntu)

**Static analysis:**

2 errors were found during analysis.

&nbsp;

1. A symbol name was expected! A reserved keyword can not be used as a column name without backquotes. (near „CHECK“ at position 522)
2. Unrecognized statement type. (near „JSON\_VALID“ at position 528)

&nbsp;

**SQL query:**

CREATE TABLE `custom_field` ( `id` BINARY(16) NOT NULL PRIMARY KEY, `name` VARCHAR(255) NOT NULL, `type` VARCHAR(255) NOT NULL, `config` JSON NULL, `active` TINYINT(1) NOT NULL DEFAULT 1, `set_id` BINARY(16) NULL, `created_at` DATETIME(3) NOT NULL, `updated_at` DATETIME(3) NULL, CONSTRAINT `uniq.custom_field.name` UNIQUE (`name`), CONSTRAINT `json.custom_field.config` CHECK(JSON\_VALID(`config`)), CONSTRAINT `fk.custom_field.set_id` FOREIGN KEY (set\_id) REFERENCES `custom_field_set` (id) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4\_unicode\_ci

**MySQL said:**

`#1215 - Cannot add foreign key constraint`
