First of all make sure you saved your game progress on your old device. If you didn’t do that, open your old game account and go to the Account section. Then link your game to Apple ID/Facebook/Google (on iOS devices) and Facebook/Google account (on Android devices).
After you save you make sure that your progress is saved, open the game on a new device and link your game to Apple ID (if you have an IOS device)/Facebook/Google (for Android device) account with your credentials.