rename the mydoc to tmpdoc.