How to change url’s in WordPress when changing domain [duplicate]

I had much success using https://github.com/interconnectit/Search-Replace-DB

Though there are Plugins for WordPress available that do a Search & Replace, i recommend the above linked script.

In older WordPress versions it was possible to move an entire site by simply replacing some strings, but as far as i know, WordPress now creates hashes/indexes for some strings you save in the db. If you simply search and replace these strings, the hashes/index wont match anymore and you lose your settings.
The script above tries to solve this and updates also the index/hash.