It is not always worth copying the whole database. Before updating a plugin, deleting old orders or fiddling with a table, a copy of just the tables you are about to touch is enough. There are two ways: in phpMyAdmin, picking the tables, or on the command line, with their names after the database.
In phpMyAdmin
| 1 |
In cPanel open phpMyAdmin and pick the database.
|
|
| 2 |
On the Structure tab, tick the boxes of the tables you want. Under the list, in “with selected”, choose Export.
|
|
| 3 |
Alternatively open the Export tab, pick the Custom method and, in the tables box, select only the ones you need.
|
|
| 4 |
Leave the format on SQL. If you will restore into a database that already has these tables, tick the option that adds DROP TABLE; otherwise the import trips over the existing tables.
|
|
On the command line (SSH or the cPanel Terminal)
With access to a terminal, the table names go after the database name. The names abc_user and abc_database are examples: use your own, with the account prefix.
| What you want |
The command |
| Just two tables |
mysqldump -u abc_user -p abc_database wp_posts wp_postmeta > posts.sql |
| Everything except one table |
mysqldump -u abc_user -p --ignore-table=abc_database.wp_options abc_database > rest.sql |
| Structure only, no data |
mysqldump -u abc_user -p --no-data abc_database > structure.sql |
| Restoring the file |
mysql -u abc_user -p abc_database < posts.sql |
The -p asks for the password at the terminal, without leaving it written in the history. The full backup, with --single-transaction and compression, is in backing up with mysqldump and restoring the copy.
|
Restoring a file like this replaces the tables it carries. By default the copy starts by dropping each table (DROP TABLE) and creating it again. Everything that changed in those tables since the copy is lost. If in doubt, restore first into a test database you created in cPanel and compare.
|
A good habit: put the date in the file name (for example posts-2026-10-10.sql) and keep it outside the site’s public folder. A file like this holds all the table’s data, encrypted user passwords included, and must not sit where anyone who guesses the address can reach it.
|
Related tables travel as a group. In a shop, orders live in several tables at once. Restoring one without the others leaves inconsistent data: orders with no lines, products with no price. Copy and restore the whole group, main table and helpers together.
|
|
Want help choosing what to copy before a big change? Tell us the application and the table.
Open a support ticket
|
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from 321,75 MT/mo (3-year plan, with coupon) See plans |