• Resolved coltenv

    (@coltenv)


    I migrated a newly-designed website from a dev server to the live domain where an old site was hosted. Everything went well with the migration, however I realized after that I need the blog posts from the old website. Is there an easy way that I can recover just the blog posts? I still have the old database, so I’m hoping I can use PhP MyAdmin to recover just the blog posts from the old database and include them in the new database that the new site uses.

    It shouldn’t really be necessary, but here’s the link to the site just in case:
    Thompson Long Range

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

    (@sterndata)

    Volunteer Forum Moderator

    you’ll need the tables wp_posts and wp_postmeta, but keep in mind those tables also contain images (attachments) and menus, so you may need to just pick up rows of type post and page and bring over only the postmeta rows that map to the posts you’re adding.

    Thread Starter coltenv

    (@coltenv)

    So I sorted the rows by type POST, and have the owns I need, but when I select them and try to export, it still exports 252 rows. I only have 4 rows that have posts. Do you know how I can select only the four rows I need?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Sorry, it’s not a WordPress question. If you’re using phpmyadmin, you might check on how to do selected exports.

    Just copy the Text Tab (HTML) [for only 4 posts] manually to new site.

    Thread Starter coltenv

    (@coltenv)

    Thanks for the help. You’re right, we’re getting away from WordPress.

    Just in case someone does stumble across this post, here’s what I ended up doing that worked and kept all of the blog post data:

    1. Opened the old database in phpMyAdmin.
    2. Ran a SQL Query on wp_posts that would display only blog posts.
    3. The query was:
    SELECT * FROM wp_posts WHERE post_type='posts';
    4. Select which posts you want to export by checking them.
    5. Where it says With Selected, check ‘export’.
    6. You can then import the .sql file that downloads to your computer into the new database under ‘wp_posts’.
    7. If you look in your WordPress dashboard, those posts should show up with their original date. The only issue is you may not have your images since those will still be linking to the old site. Easy fix by uploading the images again, or fixing the file path.

    • This reply was modified 7 years, 6 months ago by coltenv.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Restoring Just Blog Posts from a backup’ is closed to new replies.