There will probably be a significant reduction in the hashrate, at least in the early phase. That's expected because Bitcoin mining right now is heavily dependent on other sources. Miners can't just shift to solar power overnight. But I believe it will catch up eventually and a new hashrate record will be hit.
I think the issue with solar power when used in Bitcoin mining is it's unstable nature. Bitcoin mining is energy-demanding and operates 24/7 while solar power isn't around the clock and is also dependent on the weather.
The government would have to give these miners time to switch to solar. In some countries, solar batteries could be charged so that they could work around the clock. But it will be very expensive.
I don't see the need for the government to impose such rules to miners. It would be at their own loss since they make money as well from the electricity consumed by those mining farms. I would reply directly to the title of this topic, solar energy has long been a back up option for miners.
The government can make such laws when power generation is less than the demand in a country. A few years ago, Kazakhstan had to reduce electric supply to miners because it was believed that they were the cause of power outages in the city of Almaty. The government can decide to cut miners out of the power grid because of other important sectors.