Cloned Site - Clear Users And Orders

Hi,

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 :)

Hello

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
Robert
Open the admin.php script and after the following line
require(dirname(__FILE__) . '/init.php');
add
$user_ids = db_get_fields("SELECT user_id FROM ?:users WHERE user_type = ?s", 'C');
if (!empty($user_ids)) {
foreach($user_ids as $uid) {
     fn_delete_user($uid);
}
}

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

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