Use regex in postgres
select regexp_replace('name1-01.name2-02.1','(.*)-(\d+)\.(.*)-(.*)','\1.\2-\3.\4');


Assuming:


Everything before the first '-' can contain anything but '-'. 
There's always a number after the first '-' 
'name2' doesn't contain a '-'


Just guessed your requirements, basically. Might be wise for you to read a regular expression tutorial.