Hi, not to worry. You can move your existing project to a different portfolio in the project's overview section. Nothing will change except the portfolio (and program if it's under a Program too). Existing time tracked move with the project, everything is in tact with the project.
HOWEVER, if you do not want that existing time already logged to be considered part of the new portfolio's time, you'd want to either note that in reporting (pull time starting X date) or like you said, you can close this project in portfolio A with all its time in tact, and open a new project under portfolio D for new time to begin under that portfolio.
If you found this useful, please mark correct to help others : )
If this helped you, please mark correct to help others : )