← Back to Blog
Magento

How to duplicate orders in Magento 2.4.x

Sean Breeden May 3, 2025 5 min read
How to duplicate orders in Magento 2.4.x

Why would you ever need to duplicate an order in Magento? A few weeks ago I would have asked the same question. In this instance, it was caused by needed to re-send a subscription order through to an ERP after the expiration window for the order had expired at the payment provider. This script duplicates the order and assigns it a new increment ID. It does not re-authorize the card or do any other financial transactions.


Github: https://github.com/seanbreeden/magento-duplicate-order.git


Usage:

php duplicate_order.php <original_increment_id>

About the Author

Sean Breeden is a Full Stack Developer specializing in Mage-OS, Shopify, Magento, PHP, Python, and AI/ML. With years of experience in e-commerce development, he helps businesses leverage technology to create exceptional digital experiences.