Skip to content

phpMyAdmin export on cPanel — what to choose, what to skip

phpMyAdmin's export dialog has thirty options. Most of them produce a dump that will not restore cleanly. Here is the set that works for a real migration.

phpMyAdmin’s Export tab opens with two big radio buttons — Quick and Custom — and a wall of checkboxes hiding behind the second one. Most “my import doesn’t work” tickets we see started life as a Quick export, where phpMyAdmin guessed at a format and the destination MySQL version disagreed with one of the defaults. The Custom dialog is intimidating but only six of its options matter, and getting them right once means every future export from that account restores on the first try.

What’s happening

A Quick export from a cPanel phpMyAdmin produces SQL with DROP TABLE IF EXISTS, no triggers, no events, no routines, and a character set that matches whatever the connection negotiated rather than what the table actually stores. If the source has triggers or stored procedures, they are silently dropped. If the source is utf8mb4 and the connection lands in utf8, four-byte characters get mangled — most visibly, emoji in user-generated content. And if the destination MySQL is older than the source MariaDB, the dump may contain DEFINER= clauses that fail because the defining user doesn’t exist on the target.

How to verify

Before you trust an export, check that it round-trips on a scratch database:

mysql -e "CREATE DATABASE acmecorp_test"
mysql acmecorp_test < export.sql
mysql -e "SHOW TABLES" acmecorp_test
diff <(mysql -e "SELECT COUNT(*) FROM acmecorp_wp.wp_posts") <(mysql -e "SELECT COUNT(*) FROM acmecorp_test.wp_posts")

Row counts matching is the minimum. Then spot-check a row with multibyte content (a comment with an apostrophe, a post with an emoji) to confirm the encoding survived. If wp_posts has triggers or the schema includes stored functions, SHOW TRIGGERS and SHOW PROCEDURE STATUS on the test database should match the source.

The fix

  1. Use Custom, not Quick. The Quick defaults are tuned for a single use case (back up locally and restore on the same machine) and lie about everything else.
  2. Format: SQL. CSV is for analysis tools, not for restoring a working application.
  3. Compression: gzipped, always. A 400MB dump compresses to 30–60MB and downloads in a fraction of the time. phpMyAdmin handles .sql.gz natively on import.
  4. In “Object creation options”: enable DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT / TRIGGER if you want the restore to overwrite. Disable Add DROP DATABASE unless you actually want to obliterate the destination. Enable CREATE PROCEDURE / FUNCTION / EVENT / TRIGGER — these are off by default in Quick, which is how you lose your scheduled jobs.
  5. In “Data dump options”: set Syntax to use when inserting data to INSERT IGNORE for migrations where the destination may already have partial data, or INSERT for a clean restore. Set Maximal length of created query to 50000 — the default of 50000 is fine for most schemas, but if you have BLOB columns, raise to 1000000 to avoid an INSERT per row.
  6. Remove DEFINER clauses on cross-server migrations: in the SQL section, set Database system or older MySQL server to your destination’s version. Or run sed -i 's/DEFINER=[^]*@[^]*//g' export.sql after download — this strips the DEFINER and lets the routines belong to whoever runs the import.
  7. For utf8mb4 sources, ensure the export connection is set to utf8mb4 before exporting. The cPanel phpMyAdmin connection collation defaults to utf8_general_ci, which silently downcasts. Set it in the top-right dropdown before opening the Export tab.

For accounts where database migrations happen often and the export needs to be reproducible, Stack Harbor’s environment management workflow uses scripted mysqldump with the same flags every time and reserves phpMyAdmin for spot-checking, not export.