If you are looking for a way to update the order email ID, customer name and customer account link in Magento 2 directly from the database then this blog post will show you exactly this.
How to update order customer ID from the Database in Magento 2
Step 1: Open “sales_order” table in edit mode.
Step 2: Edit the below column of the sales_order table to update customer details of the order.
That’s it. Check the Magento order on the admin site and you can see customer details of the order are get updated.
If the order item type is downloadable then follow below blog post to update the downloadable link from one customer to another in Adobe commerce.