I have a site at www.firstdomain.com. I wanted to rebrand it as seconddomain.com. Alot of my pages of firstdomain.com are already listed in google for high compeitive keywords.

How do i change my brand name without affecting the rankings?

Like when people entered clicked www.firstdomain.com/hello-first-post/ they will be directed to www.seconddomain.com/hello-first-post/

Help appreciated. Thanks