Backup original file as regular file if it's a symlink.

Use cp + mv instead just mv.
Replace all occurrences of "__" to "/"