Cloned Site - Clear Users And Orders


I am in the process upgrading the CS-Cart (CS-Cart 4.11.5).
I've created the copy of the site files and the clone of the database to different development server,
and everything is working fine.

I will have to delete all the customers and all the orders form the cloned site.
Is there a way to do it from the database?
I ask this because there is tens of thousands of customers and orders, and doing it manually from the backend will take forever.

Thank you :)


By deleting directly from the database you can forget about some tables and leave garbage behind.
It's best to write a simple script that will fetch all orders, users and loop them over, using the built-in functions fn_delete_order($order_id), fn_delete_user($user_id)
Best regards
Open the admin.php script and after the following line
require(dirname(__FILE__) . '/init.php');
$user_ids = db_get_fields("SELECT user_id FROM ?:users WHERE user_type = ?s", 'C');
if (!empty($user_ids)) {
foreach($user_ids as $uid) {

$order_ids = db_get_fields(“SELECT order_id FROM ?:orders”);
if (!empty($order_ids)) {
foreach($order_ids as $oid) {

Then go to any page in the admin panel to check the result
(!) Not tested