WordPress is a script that is configured to work with a specific domain and when changing its primary domain you simply need to do a quick reconfiguration. You can do this using the phpMyAdmin tool located in your cPanel.
Once in phpMyAdmin, you will need to locate the following table: wp_options. Then look for the following two lines: siteurl and home, you will see that they contain your old WordPress domain name and you just need to modify them to the new domain.
Alternatively, if you can access the WordPress Admin panel, you can do this from the Settings -> General and modify the WordPress Address (URL) and Site Address (URL) fields.