Q.Can I replant a miniature butternut squash–not enough sun where I planted it? It’s been in the ground about 6 weeks, has about
five green small leaves, no flowers. I want to plant it where it would get direct sun at least 8 hours a day.

Certified GKH Gardening Expert
Transplanting at this point will likely kill it or set it back even further than it already has been. I would suggest leaving it and planting in the correct location next year. If you have more than one, I would try moving a few of them and leaving some.
This article will help you to grow Butternut Squash: https://www.gardeningknowhow.com/edible/vegetables/squash/growing-butternut-squash.htm