This question already has an answer here:
Starkiller Base was made out of a Planet with it's super weapon being powered by draining the nearby sun.
But how would it work for the long term? could the planet actually move? if so how and what was the energy source for this?