Export specific Magento tables from MySQL database

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!
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! ❤️