We’ve come across several situations where duplicating a WordPress database becomes necessary. Like when you’re setting up a staging environment to test new features, or when you’re migrating your site to a new host.
You may be looking to create a backup before making significant changes, or perhaps you need to clone your site for development purposes. Whatever your reason, knowing how to duplicate your WordPress database is a valuable skill for any website owner or developer.
In this guide, we’ll walk you through the step-by-step process of duplicating your WordPress database using phpMyAdmin.
When You May Need to Duplicate WordPress Database With phpMyAdmin
phpMyAdmin is a web application that helps website owners manage their databases. It has a user-friendly interface that lets you do various database-related tasks without having to use a command-line tool.
One use of phpMyAdmin is duplicating WordPress databases. To clarify, there are actually easier ways to clone your WordPress database for beginners, such as with Duplicator. You can scroll down to the last section to check out those methods if you’re more comfortable with them.
However, there may be situations where you may want to use phpMyAdmin instead:
- If you use a free migration plugin, it may not have features like database selection or advanced export/import options.
- If you’re experiencing plugin conflicts, using phpMyAdmin can bypass any potential errors and ensure a clean database duplication.
- For users comfortable with database management, phpMyAdmin offers more flexibility. You can perform tasks like searching or replacing specific data within the database before importing, which might not be readily available in plugins.
With that in mind, let’s take a look at how to duplicate your WordPress website‘s database using phpMyAdmin. We will cover different methods, and you can use the links below to quickly jump to each one:
💡 Need help with maintaining your WordPress website? Let our WordPress maintenance experts handle your site’s routine and security tasks so that you can focus on your business. We’ll take care of backups, malware removal, uptime monitoring, WordPress updates, and more.
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. Your control panel may look slightly different from our screenshots, but the steps will be similar.
If you use Bluehost, then you can navigate to the ‘Websites’ tab. After that, find your site and click on the ‘Settings’ button.
At this stage, you will find various menus and settings to manage your website and hosting.
Here, find the ‘Quick Links’ section and click on ‘phpMyAdmin.’
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.
Next, you will see a list of your WordPress database tables.
On this page, just click on the ‘Operations’ tab from the top menu.
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 rename the database. 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.
And that’s it! Your database has been successfully cloned.
After this, you can navigate to your newly duplicated database by clicking on the new database name from the left panel.
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.
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.
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.
Next, you need to create a new database where you can import this file to. This can be in the new web hosting server you’re moving your website to.
To do this, you need to open your hosting control panel’s database settings. If you use Bluehost, then you can just go back to your dashboard, find your site, and click on the ‘Settings’ button.
Now, switch to the ‘Advanced’ tab.
Then, find the cPanel option and select ‘Manage.’
In cPanel, just go to the ‘Databases’ section.
After that, click on ‘MySQL Databases.’
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.
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.’
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.
Then, go all the way down to the bottom of the page and click ‘Make Changes.’
Your newly created database is now ready.
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:
To continue, simply go to the Import tab from the top menu.
Here, click on the ‘Choose File’ button to select the .sql file you downloaded earlier.
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.
And that’s all! You have successfully imported your duplicated database.
Alternative: Use Duplicator to Duplicate Your WordPress Database (Beginner-Friendly)
As mentioned before, this phpMyAdmin method is just one way to duplicate your WordPress database.
But admittedly, this way isn’t the most beginner-friendly. If you’d rather use a plugin instead, then you can use Duplicator. This plugin lets you create a custom backup package just for your WordPress database.
Plus, there is a one-click button to restore your WordPress site’s files in an instant.
You can read more about the plugin in our full Duplicator review and our step-by-step guide on how to clone a WordPress website.
Want more WordPress cloning plugin recommendations? Check out our expert pick of the best WordPress plugins to clone or duplicate a site.
Optimize Your WordPress Experience With These Guides
Want more tips to improve your WordPress management? Check out the articles below:
- How to Install WordPress Plugins and Themes from GitHub
- How to Add an Admin User to the WordPress Database via MySQL
- How to Enable / Activate WordPress Plugins from the Database
- How to Manage Multiple WordPress Sites from One Dashboard
- Cool jQuery Plugins for WordPress That Are Easy & Powerful
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 how to restrict WordPress admin access by IP address.
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.
Moinuddin Waheed
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.
WPBeginner Support
It can certainly be a good idea to do a manual backup on the off chance there is an issue.
Admin
Jiří Vaněk
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?
WPBeginner Support
Using migration plugins can make the process easier but this is an alternative for those looking for a manual solution.
Admin
ASHIKUR RAHMAN
for moving from one subdomian to another is it safe to use Softaculous Apps Intaller clone installation options?
WPBeginner Support
We have not fully tested that but there should not be a major issue when using it.
Admin
Ram E.
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.
Konrad
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 so start now