• Hi Folks,
    Site got hacked, or spammed, or ??? I was getting alerts that the site was redirecting to .ru domains, so I whacked everything and started from scratch.

    I really don’t care about my theme, and all that other stuff at this point, just want to restore my posts.

    I did a full backup of the DB into an SQL file.

    –> Saw several entries about importing whole database from SQL files, but I only want to import the posts from my backup file. <–

    New DB name is different that original and I have the full backup in an SQL file.

    *** All I want to do is restore the posts from that SQL file. ***

    I am not a DBA by any means, so looking for detailed guidance on how to import just the posts.

    Here is the top 24 lines of the SQL file, if that helps.

    ———————–

    -- phpMyAdmin SQL Dump
    -- version 3.4.9
    -- https://www.phpmyadmin.net
    --
    -- Host: mysql50-06.wc1:3306
    -- Generation Time: May 13, 2012 at 05:08 PM
    -- Server version: 5.0.77
    -- PHP Version: 5.2.13
    
    SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
    SET time_zone = "+00:00";
    
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;
    
    --
    -- Database: <code>376517_wpjrm</code>
    --
    CREATE DATABASE <code>376517_wpjrm</code> DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
    USE <code>376517_wpjrm</code>;

    ———————–

    Using PHPMyAdmin, connecting to new DB. Not sure how to edit the SQL file so I only import the posts.

    Help please…

    Thanks so much,
    Jim

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you can, setup the old site again with the old DB info. Once it is setup, log into the admin and do Tools->Export and export your posts. Then on the new site go to Tools->Import (install the importer plugin if needed) and then upload the exported file from the old site.

    This isn’t guaranteed to work though as the hack could have added in content into your posts so you would still have to manually comb through those and edit them.

    Thread Starter theshooter

    (@theshooter)

    Hi Jarret,
    I thought about that, but I was concerned about the redirect code being in the DB.

    I have the SQL file, so I can painstakingly get the posts out of that and just redo them, one by one, I guess.

    If that’s what I need to do, or end up doing, that’s OK. I want it to be clean and with no crap, so that may be what I need to do.

    Thanks for the idea though!!!

    — Jim

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘re-installed WP new database 100%, need to import posts only’ is closed to new replies.