Export specific Magento tables from MySQL database

May 30th, 2018 1 min to read

In Magento, sometimes you may want to export specific tables for which you need to make use of command line.

To export full database, we make use of:
mysqldump --user=root --password= --host=localhost --compress --disable-keys --quick [db_name] > export.sql

In case you need to export specific tables, use the following command:
mysqldump --user=root --password= --host=localhost --compress --disable-keys --quick [db_name] [Space separated Table Names] > export.sql

salesrule
salesrule_coupon
salesrule_coupon_usage
salesrule_customer
salesrule_customer_group
salesrule_label
salesrule_product_attribute
salesrule_website

Let’s say if we want to export the following table named “salesrule”:

Then run the command below:
mysqldump --user=root --password= --host=localhost --compress --disable-keys --quick magento1937 salesrule salesrule_coupon salesrule_coupon_usage salesrule_customer salesrule_customer_group salesrule_label salesrule_product_attribute salesrule_website > export_salesrule_tables.sql

Hope this helps!

we forecast

Post a Comment

We don’t write crap content which is uninteresting, found everywhere and does not make any sense. Following our DNA, we write and speak about next generation technology, platforms and possibilities of digital commerce.

* This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.