• Resolved SystemFailer

    (@systemfailer)


    Some plugins setup new database tables with foreign keys to tables like wp_post or wp_users.

    With the presence of these foreign keys, it is preventing the wp_post and wp_users tables from getting dropped and the import cut short.

    SOLUTION:
    add “SET foreign_key_checks = 0;” on the beginning of the SQL file and then “SET foreign_key_checks = 1;” on the end of the file

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Borislav Angelov

    (@bangelov)

    Hi

    Thanks for sharing that information!

    Quick question, which version of the plugin are you using? Basically we have internal logic to handle the problem with foreign keys and I am wondering what could be the problem.

    Best Regards,
    Bobby

    Thread Starter SystemFailer

    (@systemfailer)

    I was using the latest version of the plugin.

    Thread Starter SystemFailer

    (@systemfailer)

    Oh and the table that had a foreign key to wp_post didn’t have the ‘wp_’ prefix so that could be a suspect on why the plugin didn’t detect the foreign key?

    Plugin Author Borislav Angelov

    (@bangelov)

    Hi

    Yes, we export only tables that have current WP table prefix which is configured in wp-config.php

    Best Regards,
    Bobby

    Thread Starter SystemFailer

    (@systemfailer)

    Yeah that must be why foreign keys to wp_post and wp_users aren’t detect from plugins that don’t prefix their tables, so it should be fairly safe to do a SET foreign_key_checks = 0; since it would simply duplicate the database anyway so there shouldn’t be any problem by ignoring foreign key checks when importing a database.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘foreign_keys preventing table drops’ is closed to new replies.