phpMyAdmin import file

Hello again. I recently created a new WordPress site and in phpMyAdmin I imported a sql file from my old WordPress site. I must delete the new table and leave the imported ones or what should I do?
I want to restore my posts from the old site. Thank you!

Do you still happen to have a backup of the WordPress files as well? Moving an entire WordPress installation is quite straight forward, but transplanting a database (or parts of it) of one site into another installation is more painful.

If you want to get all the content of the old installation, you can edit the wp-config.php file and change the $table_prefix setting. If you check the database in phpMyAdmin, you’ll see that around half of the tables there start with the value of that setting as it is right now. If you change this to the prefix fragment of your imported dump, WordPress should be able to use these other tables.

If you just want to move specific posts, you may be able to do that too, but it’s harder, as you’d be moving around the contents of specific tables.

1 Like

Thank you, it’s working!