• When I first started using WP I was told by my hosting company to do Custom exports and check the boxes for Add CREATE DATABASE / USE statement and
    Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT / TRIGGER statement.

    Recently support at another hosting company told me NO!!! That will completely delete everything if I import the exported db and I should only use the Quick option.

    Can someone tell me which if these two ways to export a db is correct?

    Occasionally I’ve had a problem when importing — I will get an error message at the end something like “could not import, that table already exists.”

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    It depends on what you want to do…. I usually just accept the defaults, which is to drop the table(s) then recreate.

    Thread Starter DebT

    (@debbiet)

    Thanks. So you just go with Quick option, so the defaults are left as is?

    Not sure what you mean by “It depends on what you want to do.” I don’t know a lot about databases, I just want to be able to export (make backups) before updating WP/plugins and be able to import the backup if something goes wrong.

    Update: Just now exported a db using the Quick setting, then imported it, and got this error:

    Error
    SQL query:
    --
    -- Database: <code>dbname_test</code>
    --
    --------------------------------------------------------
    --
    -- Table structure for table <code>wp_commentmeta</code>
    --
    CREATE TABLE <code>wp_commentmeta</code> (
      <code>meta_id</code> bigint(20) UNSIGNED NOT NULL,
      <code>comment_id</code> bigint(20) UNSIGNED NOT NULL DEFAULT 0,
      <code>meta_key</code> varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
      <code>meta_value</code> longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
    MySQL said: Documentation
    
    #1050 - Table 'wp_commentmeta' already exists
    • This reply was modified 5 years, 1 month ago by DebT.
    • This reply was modified 5 years, 1 month ago by DebT.
    • This reply was modified 5 years, 1 month ago by DebT.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I recommend that you use a backup plugin like “backwpup”.

    Thread Starter DebT

    (@debbiet)

    OK thanks, I’ll test that out.

    Just as an FYI, I did a second export of the db checking the two options per my first post, and was able to import it with no problem.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Correct way to backup database’ is closed to new replies.