Title: Duplicating a database.
Last modified: August 19, 2016

---

# Duplicating a database.

 *  Resolved [misterpatrick67](https://wordpress.org/support/users/misterpatrick67/)
 * (@misterpatrick67)
 * [16 years, 12 months ago](https://wordpress.org/support/topic/duplicating-a-database/)
 * Hello all,
 * I m wondering what the easiest way to duplicate a site would be? Let’s say I 
   have a site at [http://www.mysite.com](http://www.mysite.com) and would like 
   to run the same site at [http://www.mysite.com/test](http://www.mysite.com/test).
   I want both to run simultaneously and they can have independent databases but
   I want to duplicate to have the same category and post ID’s. I’m running some
   A/B tests of themes which is why I need duplicate sites running and my theme 
   is dependent on category ID’s.
 * I’m fine working with queries and changing tables in MySQL but am not sure which
   commands to use when exporting tables. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 12 months ago](https://wordpress.org/support/topic/duplicating-a-database/#post-1110549)
 * Install 2nd site first.
 * Then at 1st site do Tools->Export.
 * Then at 2nd site do Tools->Import->WordPress.
 *  Thread Starter [misterpatrick67](https://wordpress.org/support/users/misterpatrick67/)
 * (@misterpatrick67)
 * [16 years, 12 months ago](https://wordpress.org/support/topic/duplicating-a-database/#post-1110577)
 * Thanks. I actually find a great way to do it. Using myPhpAdmin I export all tables
   except wp_options. I also check the ‘Add DROP TABLE’ and ‘Add CREATE PROCEDURE/
   FUNCTION / EVENT’ boxes under Structure. I run copy the site, delete the wp_config.
   php file and proceed to install the site. I log in, activate the correct theme
   and all the relevant plugins. Then, I log in using myPhpAdmin, import the database
   I exported. This will log my out of the WP site as I’ve also overwritten the 
   wp_users table, but I can log back in using my original user name. Everything
   should work fine.
 * The trick is to not export the wp-options table.
 * My biggest problem I’ve had in the past with doing a simple WP Export and Import
   is that the mapping of ID codes doesn’t always work quite right and my themes
   depend of specific ID’s for some posts and categories.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Duplicating a database.’ is closed to new replies.

## Tags

 * [duplicate database](https://wordpress.org/support/topic-tag/duplicate-database/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [misterpatrick67](https://wordpress.org/support/users/misterpatrick67/)
 * Last activity: [16 years, 12 months ago](https://wordpress.org/support/topic/duplicating-a-database/#post-1110577)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
