Allow transfering one index to another on the same server

Allows transfer of one index to another on the same server. Along the lines refactor code a little.