delete orders by your store_id
$orders = Mage::getModel('sales/order')->getCollection()
->addFieldToFilter('store_id', $yourStoreId);
before deleting order you should delete invoice, shipment, creditmemo, Payments and quote and then delete order.
foreach ($orders as $order) {
//delete invoices
$invoices = $order->getInvoiceCollection();
foreach ($invoices as $invoice) {
//invoice items will be deleted as well
$invoice->delete();
}
//delete invoices
$shipments = $order->getShipmentsCollection();
foreach ($shipments as $shipment) {
//shipment items will be deleted as well
$shipment->delete();
}
//delete credit notes
$creditMemos = $order->getCreditmemosCollection();
foreach ($creditMemos as $creditMemo) {
//credit note items will be deleted as well
$creditMemo->delete();
}
//delete payment references
$payments = $order->getPaymentsCollection();
foreach ($payments as $payment) {
$payment->delete();
}
//delete quote
$quote = Mage::getModel('sales/quote')->load($order->getQuoteId());
if ($quote->getId()) {
foreach ($quote->getAllItems() as $item) {
$item->delete();
}
$quote->delete();
}
//delete the order. items will be deleted as well. So does addresses.
$order->delete();
}
Credit to Marius for this answer Delete all orders older than specific date by db query