3

I changed the mounting point of the harddrive with my replica from

/media/frisch/DATEN/Dok-Daniel/ISAS to

/mnt/DATEN_SSD/ISAS

When I want to synchronize this, Unison says

Warning: No archive files were found for these roots, whose canonical names are: [...] Update detection may take a while on this run if the replicas are large.

How exactly do I have to use the rootalias option to use the old archive files (internal Unison files containing the current synchronization status) without Unison having to re-read all my files?

Daniel1000
  • 779
  • 4
  • 11

2 Answers2

3

The correct syntax for rootalias is

rootalias = //new-hostname//new-path -> //old-hostname//old-path

(Find the hostname of your local computer by typing hostname in the command prompt.)

So in my case, where both drives are mounted on the local computer, I have to change my command line like this:

Old:

unison -root "/media/frisch/DATEN_SSD/ISAS/" -root "/media/frisch/DATEN/Dok-Daniel/ISAS/"

New:

unison -root "/mnt/DATEN_SSD/ISAS" -root "/mnt/DATEN/Dok-Daniel/ISAS" \
-rootalias "//frisch-ThinkPad-P51//mnt/DATEN_SSD/ISAS -> \
//frisch-ThinkPad-P51//media/frisch/DATEN_SSD/ISAS" \
-rootalias "//frisch-ThinkPad-P51//mnt/DATEN/Dok-Daniel/ISAS -> \
//frisch-ThinkPad-P51//media/frisch/DATEN/Dok-Daniel/ISAS"

Then I can synchronize the files at the new location without the slow re-reading.

However, please keep in mind the warning from the Unison author.

Warning: The rootalias option is dangerous and should only be used if you are sure you know what you're doing. In particular, it should only be used if you are positive that either (1) both the original root and the new alias refer to the same set of files, or (2) the files have been relocated so that the original name is now invalid and will never be used again. (If the original root and the alias refer to different sets of files, Unison's update detector could get confused.) After introducing a new rootalias, it is a good idea to run Unison a few times interactively (with the batch flag off, etc.) and carefully check that things look reasonable—in particular, that update detection is working as expected.

nickcrabtree
  • 358
  • 1
  • 10
Daniel1000
  • 779
  • 4
  • 11
0

Short amendment, I had real issue with DHCP added domain, this was the reason why rootalias didn't work.

E.g. I was trying to add rootalias pointing same machine, but I could not find a reason why it was not working. And finally discovered that first sync was done in other network location, where router prepended .lan as domain, and current location DHCP is providing .local domain. Thus to discover old hostname it's better to do

head -n3 ~/.unison/asddfrgrehrthtehrhtyrjyj

for old sync database, to check exact hostname at that time, and do this command to identify current hostname:

hostname
macbook.local

Then put it to config file, so as result I have:

root = /my/Archiv
root = /Volumes/BACKUP/Archiv

rootalias = //macbook.local//my/Archiv -> //macbook.lan//my/Archive
rootalias = //macbook.local//Volumes/BACKUP/Archiv -> //macbook.lan//Volumes/BACKUP/Archive

where old location is the second part, in right, and this worked.

Arunas Bartisius
  • 1,879
  • 22
  • 23