Assuming here what your referring to is the tradiitional unix hostid. If I wanted to bind software to a system I would use a dongle or some stronger means to identify a system seeing as a hostid is very arbitrary, but nevertheless..
The hostid is retrieved using the library call "gethostid". Its merely a generic value which, if unset will be based off of the ipv4 address of the host system.
See "man 2 gethostid"
In the glibc implementation, if gethostid() cannot open the file containing the host ID, then it obtains the hostname using gethostname(2), passes that hostname to gethostbyname_r(3) in order to obtain the host's
IPv4 address, and returns a value obtained by bit-twiddling the IPv4 address. (This value may not be unique.)
You can set it yourself to anything you want by putting the file /etc/hostid in place with the value you want (presumably thats the same as what comes out of the 'hostid' program on your donating box).
To set it is a little tricker though.. the file required a packed binary representation of the hostid.
I used python but you can do whatever.. (pretty sure someone knows an easier means to print packed bytes).
from struct import pack
f = open('/etc/hostid', 'w')
f.write(pack('i', 12345))
f.close()
This will set the hostid in a manner for which gethostid will return the same value as the donating box as the migrating box.