WP-CLI » Dumping specific tables using mysqldump or WP-CLI

Dumping specific tables using mysqldump or WP-CLI

For high-traffic websites, I advise developing a stagging website if you make significant updates or even switch the WordPress theme entirely.

But one significant problem I encountered while moving from the staging site to the live one is that all database tables are updated, which could result in financial loss if the website receives multiple orders in a single minute.

To get around this, I first use the mysqldump command to export certain particular tables from the live website, then I push the staging to live and import the previously exported data.

mysqldump -u root yourdatabase -t wp_postmeta -t wp_posts > dump.sql

You can also use WPCLI to export only specific tables:

wp db export --tables=wp_options,wp_users
wpxss export specific tables from database 1024x361 - Dumping specific tables using mysqldump or WP-CLI
See also  Use mysql2date to convert date string obtained from the database into a readable date

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended