Hi Fatema,
No, the dataroot parameter references the location of the moodledata directory, so if you change the latter then you need to update the former.
The repace.php script has to be run when you change from one domain to another (e.g. when you go from myolddomain.com to mynewdomain.com), because files are always referenced with their URL, like www.myolddomain/moodle/etcetera/myimage.jpg, not with the filesystem path (e.g. c:\some\path\myimage.jpg). Besides, if you check the moodledata directory, you'll never see the orginal file's name because when you upload a file, it is renamed with the value of its content hash.
So, if you find that an image (e.g. in a Page resource) is referenced like this:
http://themoodlesitename/draftfile.php/etc/image.jpg
And a PDF (e.g. in a File resource) is referenced like so:
http://themoodlesitename/pluginfile.php/etc/somefile.pdf
And themoodlesitename is the actual name of the current site, then both files are referenced correctly.
http://docs.moodle.org/27/en/Search_and_replace_tool
http://docs.moodle.org/27/en/Moodle_migration#Changed_URL_image_links_set_to_old_site