On the new phone, you just need to sign in to your account and all your past messages will be synced to the device.
When you log in, the app will ask you if you want to set the new device as the primary device on the account. You should say yes to this prompt if you are using that phone as your main phone.
Logging in to the account is the only way to change the primary device on the account. Whenever you put your SIM card in a new device, you will need to install the app and log in.