Copying a Database Table with PhpMyAdmin

Reading Time: 2 minutes

Copying a table is quick and easy to do within PhpMyAdmin. Whether you are trying to make a backup copy before changes are made, archiving data, moving data to a new site or application, or even just working on restructuring your database, PhpMyAdmin can help you get the job done in just a few clicks.

This guide assumes that you have already logged in to PhpMyAdmin.We will go over how to copy a table and go over a few of the options PhpMyAdmin gives us.

Select the Database

First, from the main page in PhpMyAdmin, use the navigation menu on the left-hand side and click on the database where the table we want to copy is located at.

Main_Page

Then, click on the table name.

Table_Name

Copy Table

Next, go to the Operations tab on the top of the page, which may be under the More option tab if the screen isn’t wide enough.

Operations

Then, under the “Copy table to” section, it has a dropdown menu that lists all the databases that our user has access to.

Chose_table_to_copy_to

So, we can copy the table into a different table or even within the same table. If we do use the same table, we need to change the table name in the next box. In this case, we will just add the number 2 to the end of the table name to make a quick backup copy.

Copy_Table_To

Table Structure

The radio button for “Structure and data” is generally what would be used to make a copy of the whole table. The term “Structure only” implies that it only copies columns and format of the table, without transferring any actual data.

This function may be useful if we want to create a similar table, but do not want to go through setting up all the column types and lengths. Then the “Data only” option will only copy the records as long as they fit within the new table’s existing structure.

If the table that we are copying the data into exists, and already has records or structure, then we would want to check the “Add Drop Table” box to remove the existing data, and then replace it with the newly copied information.

If our table does not exist, it will create that table for us. If we leave the “Adjust privileges” box checked, it means that PhpMyAdmin will grant the same level of user privileges from the original table to a new user on the new table.

To apply these actions, click on the Go button in the lower right corner.

Table_Copied

Now we can see the duplicated table in the left navigation menu.

Table_Data

Clicking on the replicated table shows that all records were copied correctly, and it has the same format as the original table!

Conclusion

PhpMyAdmin allows us to copy a database table in only a few steps right through the browser. The user interface simplifies the process and results can be seen within seconds.

Call Us Today!

We pride ourselves on being The Most Helpful Humans In Hosting™!
Our support staff is always available to assist with any issues related to this article, 24 hours a day, 7 days a week 365 days a year.

We are available, via our ticketing systems at support@liquidweb.com, by phone at 800-580-4986 or via our LiveChat interface so choose whatever method you are most comfortable with.
We work hard, so you don’t have to!

Series Navigation<< Previous ArticleNext Article >>

Author Bio

About the Author: Alex Gorzen

Alex Gorzen has been helping others with technology his whole life. He played with computers even before he could read and wants to make sure his children share that same love as they grow up. In his free time he enjoys gardening, building things, and learning new skills.

Refer a friend and get hosting credit!