Someone suggested "the cloud", but cloud saves are very broken indeed, so I would not recommend using that if you ever want to use your worlds again. If you have root on both phones, you can backup Terraria with TitaniumBackup, and restore the backup on the newer device. If you don't have root, you can try factory resetting the new device, and then use Android's built-in data transfer tool to transfer all of your applications and data, Terraria included.
That is... if you have an Android phone... hm.
With iOS, I think you can backup your old device with iTunes, and restore the backup to the new device -- though I don't use iTunes often. I'm not sure if using it would work in this case.