You can import the related products using the default WooCommerce importer with the help of a CSV file. Specify multiple comma-separated SKUs in the corresponding meta columns.
The sample CSV columns are as shown below:
Please add the following code snippet into the functions.php file of the active child theme to import related products on the basis of SKU.
Alternatively, if you need to import related products on the basis of ID, refer here.