It should stay where it is. Technically, you could remove the modules and even the hardware, but that’s a lot of work. A large portion of the cost of a solar system is the engineering, design, and installation, and you can’t take those with you. It’s better to sell the system with the house.
Fortunately, solar can significantly increase your home’s value. Find out how.