Support » Installing WordPress » How Can Import SQL Database?

  • mubashirrao

    (@mubashirrao)


    Hi Everyone!

    Yesterday night my website got hacked! 🙁 but i made a backup just before it got hacked the backup i have was made by a plugin and thats in sql format. I have that sql database and now i want to import it in my new wordpress blog on new host so i can show my posts and comments and images that i have in that database. I imported SQL database via phpMyAdmin but when i opened my blog there is no post no image no comments either :(( so please any can help me about this? how do i show my posts, comments and images? or i am importing it wrong? there was successful message after importing database. I need Help! Please guyz help me out!

Viewing 15 replies - 1 through 15 (of 24 total)
  • Moderator James Huff

    (@macmanx)

    First, follow this guide:

    http://codex.wordpress.org/Restoring_Your_Database_From_Backup

    If you’re still having trouble, make sure that your wp-config.php file is pointed at the right database.

    mubashirrao

    (@mubashirrao)

    actually my problem is that i can import my database but posts, images and comments are not showing? how do i do that? everything goes ok but it doesnt show my content.. 🙁

    Moderator James Huff

    (@macmanx)

    Are there any posts in the wp_posts table?

    mubashirrao

    (@mubashirrao)

    yeah there are many posts….

    esmi

    (@esmi)

    Forum Moderator

    Is your current install using the same version of WP as your old site?

    Hi, I’m having the same issue here. I have made an import of my old site’s database using phpmyadmin (like explained in here: http://codex.wordpress.org/Restoring_Your_Database_From_Backup)
    I did not get any error and I can see my imported tables but no posts are appearing. wp-config.php file is pointing at the correct database.

    What do I need to do next for the post to be showing ? Do I need to rename the imported tables with a wp_ prefix ? It seems that does not do the trick.

    Thank you for your help !

    Moderator James Huff

    (@macmanx)

    Do I need to rename the imported tables with a wp_ prefix ?

    No, but you should set your wp-config.php file to use whatever prefix the tables are using.

    http://codex.wordpress.org/Editing_wp-config.php#table_prefix

    If that doesn’t work for you, please start your own topic.

    Mmm, but the thing is that I have some tables with wp_ prefix and some (imported) without prefix. I added the wp_ prefix to the imported ones but I still have no posts appearing on the blog.

    What I would like is the data of the imported tables to show on the blog as new posts.

    Moderator James Huff

    (@macmanx)

    Was this a complete database import, or did you just import a few tables from another database?

    Just 3 tables actually.

    Moderator James Huff

    (@macmanx)

    That’s the problem. The tables are very interconnected, so we really can’t recommend importing specific tables.

    I also tried to import the whole database but I had the same problem. There were no new posts showing.

    Is it an idea to try to import the data only (no structure) from a CSV file directly into the original wp_posts table ?

    Moderator James Huff

    (@macmanx)

    Well, let’s go back to restoring the full database. Can you restore the full database, not just a few tables, and then provide a link to the blog so we can see what’s going on?

    Sure. I just re-exported the whole database of the old site. And successfully re-imported it in the wordpress database. Do I need to rename the tables with the wp_ prefix ? This part is not clear to me.

    The blog is http://www.djpromo.nl/wordpress

    Moderator James Huff

    (@macmanx)

    Do I need to rename the tables with the wp_ prefix ?

    What is the table prefix now, and what does your wp-config.php file say at $table_prefix ?

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘How Can Import SQL Database?’ is closed to new replies.