Hello Magento Devs,
All orders have an order status that is associated with a stage in the order processing workflow.
In this tutorial we are going to see how we can change order status programatically instead of doing it manually.
$orderId = 11111; //your order id here
$objManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $objManager->create('\Magento\Sales\Model\Order') ->load($orderId);
$newState = Order::STATE_PROCESSING;
Here are some default magento 2 order states which you can use in set Order State and Order Status:
|States & Statuses||Value|
|STATUS_FRAUD (Only Used for Order Status)||fraud|
You can read more about order status and states in magento 2 documantation page at Order Status.
If you need help with this solution, feel free to ask in the Comments section below.
I would be happy to solve your queries.