WordPress.org

Ready to get started?Download WordPress

Forums

How Can Import SQL Database? (25 posts)

  1. mubashirrao
    Member
    Posted 3 years ago #

    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!

  2. 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.

  3. mubashirrao
    Member
    Posted 3 years ago #

    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.. :(

  4. Are there any posts in the wp_posts table?

  5. mubashirrao
    Member
    Posted 3 years ago #

    yeah there are many posts....

  6. esmi
    Forum Moderator
    Posted 3 years ago #

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

  7. kristel_ttm
    Member
    Posted 3 years ago #

    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 !

  8. 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.

  9. kristel_ttm
    Member
    Posted 3 years ago #

    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.

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

  11. kristel_ttm
    Member
    Posted 3 years ago #

    Just 3 tables actually.

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

  13. kristel_ttm
    Member
    Posted 3 years ago #

    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 ?

  14. 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?

  15. kristel_ttm
    Member
    Posted 3 years ago #

    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

  16. 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 ?

  17. kristel_ttm
    Member
    Posted 3 years ago #

    The imported tables have no prefix at all. And the wp-config.php points to wp_ tables.

  18. They have no prefix? Just tables like posts and users ? Where did you export this database from?

  19. kristel_ttm
    Member
    Posted 3 years ago #

    nope, no prefix at all indeed. I exported them from plesk / phpmyadmin of the old site. I assume they have been created this way (without prefix) by the guy who created the site a few years ago.

  20. What was the $table_prefix set to in the old site's wp-config.php file?

  21. kristel_ttm
    Member
    Posted 3 years ago #

    The old site was not wordpress. So I'm not sure if there was another kind of config file pointing to the old database: http://www.djpromo.nl

  22. You can't import non-WordPress post tables into a WordPress database and expect them to just work. The database structures are probably completely different. You'll have to import the posts, if possible. What was the original site built with?

  23. kristel_ttm
    Member
    Posted 3 years ago #

    I'm not sure. it was a flash website I think.

    Hence my idea to export without structure (in CSV) and import the data directly in the wp_post table.

    Will give it a try at least.

  24. Try this plugin:

    http://wordpress.org/extend/plugins/csv-importer/

    If that doesn't work, refer to this for more options:

    http://codex.wordpress.org/Importing_Content

  25. kristel_ttm
    Member
    Posted 3 years ago #

    Thank you very much James. I just tried the CSV importer but I get the following error:

    Skipped 245 posts (most likely due to empty title, body and excerpt).
    Imported 0 posts and 0 comments in 0.20 seconds.

    I will try the other method or modify my spreadsheet manually so that the column match the structure of wordpress.

    Thank you again !

Topic Closed

This topic has been closed to new replies.

About this Topic