Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Duplicate WordPress Database Using phpMyAdmin

Are you wondering how to duplicate your WordPress database using phpMyAdmin?

Whether you are looking to set up a web development environment or transfer your site to a new host, you will need to learn how to duplicate your WordPress database. If you are a beginner, the easiest way to do this is with phpMyAdmin, which is a web application for managing databases.

In this guide, we will walk you through the step-by-step process of duplicating your WordPress database using phpMyAdmin.

How to Duplicate WordPress Database Using phpMyAdmin

Expert Tip: Looking for an easy way to duplicate your entire website, including its database, plugins, themes, content, and files? Just check out our guide on how to clone a WordPress site with the Duplicator plugin.

Why Should You Use phpMyAdmin to Duplicate WordPress Database?

phpMyAdmin is a web application that helps website owners manage their databases.

Essentially, WordPress stores all your website content in a database. If you use a WordPress hosting service, then your data is most likely stored and organized in a MySQL database.

The thing is, to interact with MySQL, you will typically need to be familiar with command-line tools, which can be difficult if you are a beginner.

This is where phpMyAdmin comes in. It has a user-friendly interface that lets you do various database-related tasks without having to write complex commands, such as duplicating your WordPress database. Other than that, you can use it to:

With that in mind, let’s take a look at how to duplicate a WordPress database using phpMyAdmin. We will cover different methods, and you can use the links below to quickly jump to each one:

Method 1: Cloning Your WordPress Database With phpMyAdmin

This method is suitable if you want to manually create a backup or set up a staging environment for testing updates and changes.

First, you need to open your WordPress hosting control panel. In our tutorial, we are working with Bluehost, which uses cPanel for its hosting account management. Your control panel may look slightly different from our screenshots, but the steps will be similar.

Once you are logged in to cPanel, simply find the phpMyAdmin icon. It’s usually inside the ‘Databases’ section.

Selecting phpMyAdmin on cPanel

Now, you are inside your web hosting’s phpMyAdmin. Here, just click the ‘Databases’ tab at the top and select your WordPress database from the list of databases.

If you are not sure what your database name is, it’s the name you input when you first installed WordPress. You can also find it in your wp-config.php file if you forget.

Selecting a database on phpMyAdmin

Next, you will see a list of your WordPress database tables.

On this page, just click on the ‘Operations’ tab from the top menu.

Selecting the Operations tab on phpMyAdmin

This is where you will duplicate your database. Go ahead and scroll down to a section called ‘Copy database to.’

In the empty field, simply write the new database name. Then, make sure the ‘Structure and data’ box is checked. This option will copy both the structure and data of the database.

Additionally, the ‘CREATE DATABASE before copying’ option should be ticked. This will automatically create a new database where the duplicated data will be located.

The rest of the settings can be left as is. All you need to do next is click ‘Go’ at the bottom.

The 'Copy database to' section on phpMyAdmin

And that’s it! Your database has been successfully cloned.

After this, you can navigate to your newly duplicated database from the left panel.

Navigating to a newly duplicated database on phpMyAdmin

Method 2: Exporting and Importing WordPress Database With phpMyAdmin

This second method is best if your hosting company does not allow users to create databases directly from phpMyAdmin. This may be the case if you are using shared hosting services where certain privileges are restricted for security reasons.

In this situation, you may not be able to see the ‘Copy database to’ section in the ‘Operations’ tab. To duplicate your database, you can use the export method instead.

Essentially, you will export your database SQL file, set up a new database, and then import that database into the new setup.

The first step is to visit phpMyAdmin and select your WordPress database like we did in the previous method. Then, in the top menu, simply click the ‘Export’ button.

Here, you need to select ‘Custom – display all possible options’ in the ‘Export method’ section.

Opening the 'Export' tab on phpMyAdmin and selecting the Custom option

Once done, just scroll to the Output section and choose the ‘Save output to a file’ option. This will make sure that your database is exported as an SQL file.

For the rest of the settings, you can leave them as they are.

Configuring the phpMyAdmin Export Output settings

Now, all you have to do is scroll down to the bottom and click ‘Export.’

Your browser will now download the WordPress database as an .sql file.

Clicking the Export button on phpMyAdmin

Next, you need to create a new database where you can import this file to.

Go ahead and open your hosting control panel and click on ‘MySQL Databases.’

Opening the MySQL Databases page on cPanel

On this page, you need to fill out your new database name. In our example, we used _copy after the original database name to differentiate the old name from the newly duplicated one.

After that, just click the ‘Create Database’ button.

Creating a new MySQL Database on cPanel

Now that we’ve created a new database, let’s assign it to a MySQL user.

Go ahead and scroll down the ‘Add User to Database’ section and select a MySQL username from the dropdown menu. Make sure to choose the new database you’ve just created in the ‘Database’ field.

Once done, click ‘Add.’

Adding a new user to the MySQL Database on cPanel

You will now be redirected to the ‘Manage User Privileges’ page.

Simply check the ‘ALL PRIVILEGES’ option if you want to have total control over your database.

Checking the All Privileges option when adding a new MySQL user on cPanel

Then, go all the way down to the bottom of the page and click ‘Make Changes.’

Your newly created database is now ready.

Clicking the 'Make Changes' button to set the privileges of a new MySQL user on phpMyAdmin

Let’s go ahead and open phpMyAdmin again and select the database you just created in cPanel.

Once inside, you’ll see that the database is empty without tables like this:

No tables found in database message on phpMyAdmin

To continue, simply go to the ‘Import’ page from the top menu.

Here, click on the ‘Choose File’ button to select the .sql file you downloaded earlier.

Choosing an SQL file to import in phpMyAdmin

Once finished, scroll down to the bottom and click the ‘Import’ button.

phpMyAdmin will now upload the file from your computer and import your database.

Clicking the Import button on phpMyAdmin

And that’s all! You have successfully imported your duplicated database.

Bonus: Optimize Your WordPress Database for Better Performance

Managing the behind-the-scenes part of your WordPress website is just as important as how it looks on the outside. How you handle your database affects how fast your site loads, how secure it is, and how easily people can use it.

If your database is cluttered with unnecessary data, it can slow down your site and make it vulnerable to security risks. Regularly optimizing your database can prevent this from happening and make your website more reliable.

For more information about database management, you can see our beginner’s guide on managing a WordPress database with phpMyAdmin and our article on how to optimize your WordPress database with one click.

We hope this article has helped you learn how to duplicate a WordPress database using phpMyAdmin. You may also want to see our expert pick of the best WordPress database management plugins and our tutorial on how to fix the establishing a database connection error in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

9 CommentsLeave a Reply

  1. Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. I have faced a wrong backup problem with one of my websites where I used a backup plugin and was convinced that all my posts and pages would have been backed up. But after few days when I wanted to get those files on my new website, it was completely lost.
    Doing backup manually through the php myadmin dashboard is a wise decision and it gives confidence and satisfaction that I can revert and use that backup whenever I would need it.
    Thanks for this guide for making backup manually.

    • It can certainly be a good idea to do a manual backup on the off chance there is an issue.

      Admin

  3. Wouldn’t it be easier to create a database dump and import it to the new server if I were to migrate the website? Alternatively, if I wanted to duplicate a website to create a live version and a development version, wouldn’t using a staging plugin, which duplicates the database and allows transferring changes from the development to the live version, be a better option for beginners?

    • Using migration plugins can make the process easier but this is an alternative for those looking for a manual solution.

      Admin

  4. for moving from one subdomian to another is it safe to use Softaculous Apps Intaller clone installation options?

    • We have not fully tested that but there should not be a major issue when using it.

      Admin

  5. Another helpful guide! Although I find it a bit complicated.

    I set up a staging environment before switching to WordPress 6.4 using the Softaculous Apps Intaller on Bluehost. It was easy to do with a click, although you have to make sure first that the subdomain or directory where you want to install the clone is available.

  6. i’ve bitten into SQL challenges before for my technical school exam, so no problem here :p also,
    there are two types of people: those who don’t backup their databases and those who will :D so start now ;)

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.