将一个drupal站点复制到另一个drupal站点并复制带前缀的数据库后,Drupal数据库错误

时间:2022-09-12 08:30:25

I duplicated a Drupal site and the database from the first one to another. Of course i copied files from 1st instance to 2nd.

我将Drupal站点和数据库从第一个站点复制到另一个站点。当然我将文件从第一个实例复制到第二个实例。

Now i encounter a database error when i try to add a content to the page, but ONLY content.

现在,当我尝试向页面添加内容时遇到数据库错误,但只有内容。

Full error

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Kolumna'entity_id' nie może być null: INSERT INTO {field_data_body} (entity_type, entity_id, revision_id, bundle, delta, language, body_value, body_summary, body_format) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => CONTENT TYPE I TRY TO ADD (here its podstrona) [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => adawdawd [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => html ) in field_sql_storage_field_storage_write() (line 494 of /home/username/domains/domain/public_html/subdomain/modules/field/modules/field_sql_storage/field_sql_storage.module).

PDOException:SQLSTATE [23000]:完整性约束违规:1048Kolumna'entity_id'niemożebyćnull:INSERT INTO {field_data_body}(entity_type,entity_id,revision_id,bundle,delta,language,body_value,body_summary,body_format)VALUES(:db_insert_placeholder_0, :db_insert_placeholder_1,:db_insert_placeholder_2,:db_insert_placeholder_3,:db_insert_placeholder_4,:db_insert_placeholder_5,:db_insert_placeholder_6,:db_insert_placeholder_7,:db_insert_placeholder_8);数组([:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3] =>内容类型我尝试添加(这里是podstrona)[:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] = > und [:db_insert_placeholder_6] => adawdawd [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => html)in field_sql_storage_field_storage_write()(/ home / username / domains / domain / public_html / subdomain / modules / field / modules /的第494行) field_sql_storage / field_sql_storage.module)。

To be very precise: 1st i copied all files from 1st instance to 2nd (which is hosted on a subdomain) then i deleted the 2nd db, then i copied the 1st database with specific prefix (of course matching the installation prefix). Most interesting is the fact that i can add content types, views etc, but i cant add any content to the page cause above error prompts.

非常精确:第一次我将所有文件从第一个实例复制到第二个(在子域上托管)然后我删除了第二个数据库,然后我复制了具有特定前缀的第一个数据库(当然与安装前缀相匹配)。最有趣的是我可以添加内容类型,视图等,但我不能添加任何内容到页面导致上面的错误提示。

I will really appreciate any help, and thanks in advance!

我将非常感谢任何帮助,并提前感谢!

1 个解决方案

#1


It may be that database is corrupted or some data was entered and then some database rules were changed and those data become illegal or something.

可能是数据库已损坏或输入了一些数据,然后某些数据库规则被更改,这些数据变得非法或类似。

Anyway, try importing it from console and use --force option.

无论如何,尝试从控制台导入它并使用--force选项。

#1


It may be that database is corrupted or some data was entered and then some database rules were changed and those data become illegal or something.

可能是数据库已损坏或输入了一些数据,然后某些数据库规则被更改,这些数据变得非法或类似。

Anyway, try importing it from console and use --force option.

无论如何,尝试从控制台导入它并使用--force选项。