This is my first attempt:
$orderId = 57;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $objectManager->create('\Magento\Sales\Model\Order')->load($orderId);
$order->setState(\Magento\Sales\Model\Order::STATE_PROCESSING, true);
$order->setStatus(\Magento\Sales\Model\Order::STATE_PROCESSING);
var_dump($order->getStatus()); // here i can see that it is processing
$order->save(); // if i put this in a try and catch, no exception is thrown
another attempt:
//using OrderRepositoryInterface
$order = $this->orderRepositoryInterface->get(57);
$order->setState('processing')->setStatus('processing');
$this->orderRepositoryInterface->save($order); // if i put this in a try and catch, no exception is thrown
Are they other approaches to try to change the order state and status ? Or am i doing something wrong with my attempts? since they are not working :(
Thank you