GRUB2 UUID when moving/changing partitions

problems when copying the OS/boot partition to another disk  

When moving my boot partition from one disk to another, I found GRUB2 maintained the UUID of the original drive (sda) and would not store the UUID for the second one (sdb).
This meant the machine would also boot from the old drive (sda) and mount the old drive as the root (/)

To fix this, first of all I modified /boot/grub/grub.cfg on the old drive (sda)
You may need to: chmod +w grub.cfg

I then replaced all the old UUID's with the new one

Then I rebooted and forced the computer to boot from the new drive (sdb).

Finally I ran:
grub-install /dev/sdb
update-grub2 and the correct config file was generated

One final reboot, and everything booted and ran from the new drive (sdb)