Hi,
1. They got there because you created them. It's quite easy. For example, create a product and add 6 characteristics with 10 values each. With old versions of HikaShop, with the option to generate variants automatically activated it would create a million variants for these. With recent versions of HikaShop, you would have to add yourselfs the values of all the characteristics when clicking on the "add variants" button of the Variants tab. So it's still possible to easily generate so many variants for a product, but it's a more conscious process.
2. You can theoretically see them on both the frontend and the backend. If you edit a product with the variants, you can go in the Variants tab and see them, same on the product page. But since a million elements is too much to load, the product edition page or product details page will just crash and you'll get a blank page.
If the product page displays fine, it means that the product you're working with is not the culprit.
3. There is no glitch which would create them. It has to have been done by someone on your end, not knowing what he was doing.
4. I don't know what you have to delete exactly.
5. Yes, the data is in the table hikashop_product
6. That's the hard part.
7. You would be able to export a CSV file of all the products.
But yes, please do a backup before starting just in case.
You'll have to check the data in the hikashop_product table. Try first to look at an entry in the middle and pick it randomly. There is a 99% chance that it is an entry you don't need.
For example which such query:
SELECT * FROM air_hikashop_product WHERE product_id=1000001
Look at the product_parent_id column of that element.
That will give you the product_id of the main product corresponding to that variant.
Then, run this query:
SELECT * FROM air_hikashop_product WHERE product_id=XXX
where XXX is to be replaced by the product_id of the variant you got above.
That will give you a product_name and product_code that you can search in your backend/frontend.
You'll be able to confirm that you can edit it or display its product page.
So you'll want to delete it and all its variants. You'll be able to do that with such query:
DELETE FROM air_hikashop_product WHERE product_id=XXX OR product_parent_id=XXX
And that should remove the million entries associated with that product.
Rince and repeat the process until you have a decent amount of entries left in the hikashop_product table.