Skip to content

Using phpMyAdmin to copy a MySQL database

phpMyAdmin provides a simple way to duplicate a database. This is useful for creating backups, testing changes, or migrating data to a new environment.

  • Create a backup before making major changes.
  • Set up a staging environment for testing.
  • Duplicate data for migration to another domain or server.

This is the most common and reliable way to copy a database.

  1. Log in to cPanel → phpMyAdmin.
  2. Select the database you want to copy from the left sidebar.
  3. Click the Export tab.
  4. Choose Quick export method and SQL format.
  5. Click Go → download the .sql file to your computer.
  1. In cPanel → MySQL Databases, create a new database.
  2. Create a new user and assign it to the database with ALL PRIVILEGES.
  1. In phpMyAdmin, select the new database.
  2. Click the Import tab.
  3. Upload the .sql file you exported.
  4. Click Go → phpMyAdmin imports all tables and data.

Method 2: Copy Within phpMyAdmin (Single Database Server)

Section titled “Method 2: Copy Within phpMyAdmin (Single Database Server)”

phpMyAdmin also allows copying tables directly if both databases exist on the same server.

  1. Log in to phpMyAdmin.

  2. Select the source database → choose a table.

  3. Click Operations tab.

  4. Under Copy table to (database.table):

    • Enter the destination database name.
    • Choose whether to copy structure only or structure and data.
  5. Repeat for each table until the database is duplicated.

  • Export/Import is recommended for full database copies.
  • Table‑by‑table copy is useful for partial duplication.
  • Always back up before making changes.
  • Large databases may take longer to export/import.