Yes, I did those steps and got an error, which led me here: “If you get an error message, your best bet is to post to the WordPress support forums to get help.”
Here is the error I got when trying to import the database:
Error
SQL query:
—
— Database: michaelb_wpmb
—
— ——————————————————–
—
— Table structure for table wp_comments
—
CREATE TABLE wp_comments (
comment_ID bigint(20) UNSIGNED NOT NULL,
comment_post_ID bigint(20) UNSIGNED NOT NULL DEFAULT ‘0’,
comment_author tinytext COLLATE utf8mb4_unicode_ci NOT NULL,
comment_author_email varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ”,
comment_author_url varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ”,
comment_author_IP varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ”,
comment_date datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
comment_date_gmt datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
comment_content text COLLATE utf8mb4_unicode_ci NOT NULL,
comment_karma int(11) NOT NULL DEFAULT ‘0’,
comment_approved varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘1’,
comment_agent varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFA[…]
MySQL said: Documentation
#1050 – Table ‘wp_comments’ already exists
Thatβs odd, did the table already exist before you started the import? Also, how did you generate the backup?
The table that existed is in the .sql file from when the site was active three years ago. I assume these are typical tables for even old WP installations.
Well, I just tried exporting the .sql database as an .xml file, then importing it into WP using the Import tool. I got this message:
Sorry, there has been an error.
This does not appear to be a WXR file, missing/invalid WXR version number
Right, changing the file extension does also change it into a WordPress export file. You can only generate that from within a WordPress site’s Dashboard.
What I meant earlier was, do tables already exist in the database you’re importing this to?
Yes, the table I’m importing into is the database created by the new WP installation.
Ah! That’s the problem. π
Since you’re importing a whole WordPress database, you don’t need the tables created by the existing new WordPress database.
So (assuming this new installation is bare with no content), delete those newly created tables, and import your database.
So, delete all the tables in the new database?
Assuming this new installation is bare with no content, yes.
Then import the new database.
OK, I’ll give that a try, thanks!