PhD student funding from another professor?
This might be highly dependent on your personal situation and there might be more implications. Please note that the other professor might have additional requirements or wants to see additional topics in your thesis.

I would try to address this issue openly and talk to your supervisor. Express clearly that you have the goal of finishing your dissertation in the next two years and discuss whether this is possible with his offer. Ask him whether this project is really not related to your dissertation and how much effort and time it will take. If you realize that this is not a viable option for you and if there is no other acceptable solution, explain in a friendly manner that you consider alternatives.

Trying to hide everything from your supervisor and suddenly vanishing is definitely not the way to go as this might burn bridges.