I need help fixing a failed SQL import to my WP website please


I setup a new WP website a fresh install so I can move over my old site from another hosting provider. I did a SQL export from the old site. Then an import to the sql db on the new site. I had done this on other sites fine but for some reason on this one it just appended the tables with a different prefix and as a result my site can't see any of my data and there's two sets of tables each with different prefixes.

Can you please instruct me as how to fix this and perhaps understand how it happened so I dont' do it again?

I'm told there was a line of code in the original db dump specifying the creation of a new set of tables or prefix on import?

Please help. If you need access let me know I'll provide control panel and site admin access via private message. THANK YOU!

  • Sajid

    Hi @jsegal,

    Hope you are doing good today :slight_smile:

    I am assuming you have imported all tables of WordPress websites. If yes then simplest solution is just replace the existing table prefix in wp-config.php file with the old one.

    Here are steps to do this job.

    1. Download the wp-config.php file (can be found in the folder where you installed WordPress) and download via FTP or FileManager.

    2. Take backup of this file (very important).

    3. Find the following variable (value can be different for you).
    $table_prefix = 'wp_';

    4. Now replace it with the prefix with imported db tables.
    $table_prefix = 'yourprefix_';

    5. Save changes and upload back to the server.

    To the answer why its happened, because when you import the tables via phpMyadmin manually then you have to take care of prefix, old urls and sites tiles etc..

    That's why we have a developed awesome plugin to make the migration process easy and flawless and I have already mentioned in your other similar thread.

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:
    Cheers, Sajid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.