WP categories Dissapeared

8 replies
I had to redo my WP site because some files got corrupted. So I did a fresh install of WP and imported my db. I have all the posts but for some reason the categories did not port over. They are all uncategorized. Has anyone got an idea on how to fix this? Please advise.
#categories #dissapeared
  • Profile picture of the author mywebwork
    Hi Tony

    How did you "import" your data - did you use the WordPress Dashboard "Import" feature, or did you use a backup of your MySQL database?

    It may provide a clue to solving this mystery!

    Bill
    {{ DiscussionBoard.errors[4436583].message }}
    • Profile picture of the author warfore
      I used the backup feature of mysql database in the php admin area on cpanel.
      Signature

      Regards,

      Tony

      {{ DiscussionBoard.errors[4438685].message }}
  • Profile picture of the author mywebwork
    OK, that helps.

    Now lets go over how you did it, here is what I am assuming - please correct me if I am wrong:

    1- You did a MySQL backup of the old site with PHPMyAdmin, and saved the .sql file locally.

    2 - You rebuilt the new site from scratch (because of your "corrupted files" you chose not to do a file backup & restore). You included the same plugins and made absolutely sure that both WordPress and your theme & plugins were at the exact same version level, and that the plugins were configured identically to the original site.

    3 - You crated a new, empty database on the new sites server and also created a database user with appropriate permissions.

    4 - You used the .sql file you made in step 1 to populate the new database

    5 - You edited your wp-config.php to point to the new database, instead of the one created when the new installation of WordPress was created.

    Again I just want to be sure that this is exactly how you did this - if not please tell me where I guessed wrong.

    Your categories are held in the wp_terms table in your database, so if the id numbers are off the only category that will be correct is "uncategorized". However I am at a loss to explain why they would be off, if indeed you created a brand new database and used the data your backed up to restore it?

    Bill
    {{ DiscussionBoard.errors[4440572].message }}
    • Profile picture of the author warfore
      OK, that helps.

      Now lets go over how you did it, here is what I am assuming - please correct me if I am wrong:

      1- You did a MySQL backup of the old site with PHPMyAdmin, and saved the .sql file locally.
      Backup was done with the DB Backup plugin
      2 - You rebuilt the new site from scratch (because of your "corrupted files" you chose not to do a file backup & restore). You included the same plugins and made absolutely sure that both WordPress and your theme & plugins were at the exact same version level, and that the plugins were configured identically to the original site.
      Not exactly...I did rebuild from scratch but I used Fantastico and it put the latest WP version. The plugins also did not port over (there were errors and they did not restart and self deleted). I just assumed that I would have to reload them.

      3 - You crated a new, empty database on the new sites server and also created a database user with appropriate permissions.
      No, used Fantastico.

      4 - You used the .sql file you made in step 1 to populate the new database
      Yes, using the import function of pHp Admin in cpanel.
      5 - You edited your wp-config.php to point to the new database, instead of the one created when the new installation of WordPress was created.
      No, Fantastico installation and thanks for the help



      Again I just want to be sure that this is exactly how you did this - if not please tell me where I guessed wrong.

      Your categories are held in the wp_terms table in your database, so if the id numbers are off the only category that will be correct is "uncategorized". However I am at a loss to explain why they would be off, if indeed you created a brand new database and used the data your backed up to restore it?

      Bill
      Signature

      Regards,

      Tony

      {{ DiscussionBoard.errors[4442145].message }}
  • Profile picture of the author onlinecasinodeck
    Originally Posted by warfore View Post

    I had to redo my WP site because some files got corrupted. So I did a fresh install of WP and imported my db. I have all the posts but for some reason the categories did not port over. They are all uncategorized. Has anyone got an idea on how to fix this? Please advise.
    Have you restore the whole configuration, ad-ons and widgets?
    Signature
    {{ DiscussionBoard.errors[4440704].message }}
  • Profile picture of the author mywebwork
    Hi Tony

    OK, now it starts to make sense!

    I'm pretty sure that the way you did it failed to exactly replicate the MySQL database, specifically the wp_terms, wp_term_relationships and wp_term_taxonomy tables. Without those being replicated correctly you will suffer the exact problem you are having now.

    Steps 3, 4 & 5 are where you went wrong - step 2 was also not the best way to do things, but it wouldn't cause this particular problem (although you may run into some other ones).

    You may have to start from scratch with a build of the exact same version of WordPress, however as a possible "quick fix" you can try this first:

    1- Use the MySQL Databases utility in your CPanel (not the MySQL Database Wizard!) and create a brand new database. Create a brand new database user. Then associate the user to the database, giving the user full permissions. Make note of the complete database name, user name and password.

    2 - Use PHPMyAdmin and restore the .sql file you made with your backup utility to this new database.

    3 - In the root of your WordPress directory make a backup of your wp-config.php file. Then edit the original wp-config.php file and replace the database name, username and password with the ones you saved in step 1. Save the changes.

    Now go to your WordPress site and see if it fixed it. If it didn't I think you will need to start from scratch, replicating the exact environment you had backed up first and them performing these steps. I believe the WordPress SVN repository has all the previous versions of WordPress available if you need them.

    Hope this helps.

    Bill
    {{ DiscussionBoard.errors[4442764].message }}
    • Profile picture of the author warfore
      Bill, I'm glad you responded because I just did the exact thing you outlined in your inquiry for the previous post and where you also outlined in your latest post. I'm glad to report that your steps worked perfectly and I have all of my categories (and tags that were gone) back as they were. Thanks again so much.
      Signature

      Regards,

      Tony

      {{ DiscussionBoard.errors[4442805].message }}
  • Profile picture of the author mywebwork
    Hi Tony

    Glad I could help, and glad to hear you got it working!



    Bill
    {{ DiscussionBoard.errors[4443046].message }}

Trending Topics