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!

Dimple Mishra
Speak your Mind

Post a Comment

Got a question? Have a feedback? Please feel free to leave your ideas, opinions, and questions in the comments section of our post! ❤️

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

Grow your online business like 4,885 subscribers

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

    Thank You!

    We are reviewing your submission, and will be in touch shortly.