0
votes

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

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).

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
Did you try this multiple times? Try importing db using command line. - Bhavin Joshi
yes i tried 2 times, but no effect. I will try today too, maybe it will work with console. - tdbr
That is the issue. Clean entire db by removing all the tables. And then try again. This time, with CLI - Bhavin Joshi
Can you provide some information on how to use this command line? Very important is the fact that i have no acess to the admin account on my database fe. i cant make new databases - tdbr
mysql -u [db username] -p [database to import to] < [path to the .sql file] When prompted, you need to provide the db password for the respective user. To use this command on CLI, you should connect to your server using SSH. - Bhavin Joshi

1 Answers

0
votes

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.