1

I'm a beginner in Drupal. I want to import my database to my webserver and get this error when trying to do so:

"#1062 - Duplicate entry 'comment_publish_action' for key 'PRIMARY'"

I don't know how to fix this error.

Here are more details about it:

INSERT INTO actions (aid, type, callback, parameters, label) VALUES ('comment_publish_action', 'comment', 'comment_publish_action', '', 'Publish comment'), ('comment_save_action', 'comment', 'comment_save_action', '', 'Save comment'), ('comment_unpublish_action', 'comment', 'comment_unpublish_action', '', 'Unpublish comment'), ('node_make_sticky_action', 'node', 'node_make_sticky_action', '', 'Make content sticky'), ('node_make_unsticky_action', 'node', 'node_make_unsticky_action', '', 'Make content unsticky'), ('node_promote_action', 'node', 'node_promote_action', '', 'Promote content to front page'), ('node_publish_action', 'node', 'node_publish_action', '', 'Publish content'), ('node_save_action', 'node', 'node_save_action', '', 'Save content'), ('node_unpromote_action', 'node', 'node_unpromote_action', '', 'Remove content from front page'), ('node_unpublish_action', 'node', 'node_unpublish_action', '', 'Unpub[...]

1
  • My guess would be that you are trying to import into a database that already contains entries. In that case the backup needs to be created in such a way that it drops existing tables before recreating them. Jun 17, 2015 at 11:57

2 Answers 2

0

From the information provided in the question so far, it is hard to tell what is causing your problem (consider refining your question by editing it).

However, as an alternative, you may want to consider using the Backup and Migrate module like so:

  • install that module on both Drupal sites (where you want to export from, and where you want to import to).
  • use this module to create a backup in the originating Drupal site (and save it somewhere to a local file), of the relevant tables in the MySQL database.
  • use this module to restore that "local file" (= backup) to import it in your target site (which is where you're currently encountering the problem.

Does this help somehow?

0

i had the same problem when upgrading (or after upgrading) from D6 to D7. i am guessing rule module.. go to /admin/config/system/actions/orphan, there is no orphan menu, just type 'orphan' in url. log will show that action was deleted. After visiting orphan path, importing users table error '"#1062 - Duplicate entry 'comment_publish_action' for key 'PRIMARY'"' was gone when importing users table to different database in my case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.