Remapping absolute URLs from other domains and from test domain

Absolute or relative URLs are one of those eternal debates, but what you have to know in WordPress context is that it has strong affinity for absolute links. The logic is that changing absolute links in general is easier than changing level of relative links when necessary.

The second point you need to know is that WordPress stores a lot of stuff in serialized representation. Running simple string replacement on database or database dump is likely to break data.

So what you need is specialized serialize–aware search/replace tool. There are quite a few solutions around, standalone or as functions of backup plugins. I am partial to Search-Replace-DB personally.