• I migrated my site a new host and imported the database using phpAdmin (NOT the WordPress tools). Everything works great except 23 years’ worth of posts… I can see them in the database, but they do not appear on the site OR in the wp-admin dashboard. I’ve read every article I can find on this subject and have tried so many things… nothing has worked (disabled plugins, changed themes, deleted/restablished htaccess file, changed permalinks, etc.). Does anyone have any other suggestions? I cannot possibly recreate two decades’ worth of posts from scratch. I’m tearing my hair out here. ??

Viewing 15 replies - 1 through 15 (of 15 total)
  • Check if the wordpress you are looking into is also accessing the database you are looking into. You should be able to see this in the wp-config.php for the database.

    Thread Starter deck2deck

    (@deck2deck)

    Thank you, yes — that was the first thing I checked. It is indeed connecting to the correct database, and all the posts are there in the backend; just not showing in the front end OR via the admin dashboard. I’m at my wits’ end over here trying to figure out what the issue is. ??

    What is the difference between dashboard and backend for you? If you see the posts in the WP backend under posts, then you should be able to call them from there also for the frontend.

    A link to the page might help.

    Thread Starter deck2deck

    (@deck2deck)

    I see the posts in the database via phpMyAdmin. I cannot see them when logged into my website via mywebsite.com/wp-admin, nor are they viewable from the front end (i.e. by a website visitor via a browser).

    hi, can you add this code and answer the result here?

    add_action('init', function(){
       print_r(wp_count_posts());
       exit;
    });

    You can try this code creating for example a mu-plugin named test.php: in wp-content create a subfolder called mu-plugins if it doesn’t exits. In wp-content/mu-plugins create a file called test.php and write the php code mentioned before.

    Do you even see any content of yours in the WP backend? Media files? Other pages?

    Do you even see any content of yours in the WP backend? Media files? Other pages?

    I was thinking of this as well!

    Specifically, do you see the default content that comes with a fresh WordPress installation (“Hello World”, “Sample Page”, etc)… or is there no content at all?

    I helped resolve a similar issue here recently. In that specific case:

    — User first installed a fresh WordPress at the new host, using the default wp_ table prefix.

    — User then imported the old database which had a different table prefix into the existing database used for the new WordPress installation (using phpMyAdmin)…

    So the WordPress database had pairs of tables with two different prefixes.

    Meanwhile, the wp-config.php file still had wp_ (the new installation), so none of the content from the imported database was visible in the dashboard.

    As far as WordPress was concerned, there were two different WordPress sites in one database!

    The obvious solution was to edit wp-config.php to change the database prefix to match the prefix of the imported database tables (and optionally delete the tables with the wp_ prefix). Or, empty the entire database, import the SQL again, and change the prefix in wp-config.php.

    This may be a totally different issue, but that’s another possibility to check and rule out.

    Thread Starter deck2deck

    (@deck2deck)

    @miguelmartinezlopez: Thank you, I did as you suggested but not sure what to do next? I tried to pull up the test.php file in a browser and simply got a 404 error (mywebsite.com/test.php — is that what I was supposed to do?)

    @gappiah: Thank you. Yes, I’m able to see the default content; I have replaced it all with my custom content. I did think about deleting the entire database and starting over, but concerned that I will delete all the customizations that I’ve already made. (In hindsight, I should have used the WP export/import feature to move the posts but didn’t realize that until it was too late).

    The new database did indeed have a different name, so I changed it to match the imported database name (wp_123 to wp_456) and then updated wp_config to match. That did not do the trick (didn’t break anything, thankfully, but did not make the posts appear).

    I’ve reached out to my host for assistance but — five days later — my support ticket is still just sitting there, so I don’t think they will be willing to help.

    @gappiah meant the prefix, not the database name. This is the line that should look something like this in wp-config.php:

    $table_prefix = 'wp_';

    There you have to enter the prefix with which the database tables in your database are provided.

    Thread Starter deck2deck

    (@deck2deck)

    Aha!!! That is exactly the issue. There are two sets of tables in the database, which I did not notice. The correct set (which wp_config is pointing to, and which has all my customizations) is set to wptt_. The imported posts from the old site are in wp_.

    I tried changing the wp_config file from wptt_ to wp_ and that broke the site. So, I changed it back of course. Now I need to [move/rename?] the wp_posts table to wptt_posts but not sure of the correct procedure to do so?

    THANK YOU BOTH so much!! Together you have saved me hours of work. Now I just need guidance on this last little bit.

    No, you should not rename tables. They also have links to other tables, so you may break data.

    Do you still have the backup from the original project before the move? Then use it.

    Otherwise you could only get it over via export/import of the wordpress tools.

    Thread Starter deck2deck

    (@deck2deck)

    @threadi: I do still have the original export. So I started over and created a completely new (empty) database. I imported the export from the old site into the new empty database, and adjusted the settings in wp_config to point to the brand new database… but got the exact same issue. The posts show in phpadmin (3214 rows) but they are not showing up in the WordPress dashboard. I just don’t get what I’m doing wrong (it shouldn’t be this hard!) phpMyAdmin > export and phpMyAdmin > import, correct? What else am I missing?

    Look in the database for the prefixes of the tables. Are they different? Then you may have entered the wrong prefix in wp-config.php again.

    Thread Starter deck2deck

    (@deck2deck)

    TY to everyone who tried to help! I finally resolved the issue this way:

    Created a complete new, empty database at the new host
    Imported the original backup into it
    Changed wp-config to point to new database
    Used the WP plugin to export just the posts
    Changed wp-config back to the existing (troublesome) database
    Used the WP plugin to import the posts
    Adjusted the permalinks
    Voila!! Everything is working now and I didn’t have to rebuild the site from scratch, which was my fear (I had made many, many customizations).

    Lesson learned! Next time: export using the WP tool BEFORE pointing the domain name to a new server!

    Thank you again @threadi and @gappiah — I appreciate you!!!

    Thank you Google. I was going crazy having the same problem until I came across this post. I could see the prefix in the tables was different but didn’t know how to fix it. THANK YOU all for this post.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Posts do not appear on the Dashboard’ is closed to new replies.