I will walk you through this step by step.
- Create a copy your production environment on your development environment.
- You will need to export/import your production server MySql database via phpMyAdmin. For a good tutorial in how to do this, go to: https://mediatemple.net/community/products/dv/204403864/export-and-import-mysql-databases
- Using phpMyAdmin on your dev database, export all rows from every wp_ table, excluding the wp_posts table.
- From your dev/production database, import all rows in to the appropriate tales.
- Test your dev/production site for errors or problems.
It is likely that some of the rows in the wp_posts table has data not related to just Wordpress Posts. You will need to identify these as well by running a SQL query, such as:
SELECT * FROM wp_posts WHERE post_type='some_id'
Breaking down the SQL query for you:
[SELECT *]
Select All
[FROM wp_posts]
From the table "wp_posts"
[WHERE post_type='some_id']
'some_id' is associated with a post type.
Themes, plugins and other functionality are often extended through:
wp_posts table -> post_type='some_id'
.
The default value for Wordpress posts is:
post_type='posts'
.
Rows within the wp_posts table that DO NOT have the
post_type='posts'
value should be migrated over to your production server.
References:
Wordpress Database:
https://codex.wordpress.org/Database_Description
MySql Select a Row Query:
https://codex.wordpress.org/Class_Reference/wpdb#SELECT_a_Row
Wordpress Database Diagram:
https://codex.wordpress.org/images/2/2a/WP3.9.4-ERD.png
Export and Import MySql
https://mediatemple.net/community/products/dv/204403864/export-and-import-mysql-databases
Connecting to a Wordpress Database with wp-config.php
https://codex.wordpress.org/Editing_wp-config.php