Difference between revisions of "UpgradeDisk"
Line 69: | Line 69: | ||
# signal-event reboot | # signal-event reboot | ||
# Shutdown and remove old drive | # Shutdown and remove old drive | ||
+ | |||
+ | |||
===Reference information=== | ===Reference information=== |
Revision as of 23:10, 29 June 2008
Upgrade Disk
Introduction
Hard drive restore requires a complete system. It is meant to take a hard drive from a system, mount it, and do a restore from it.
It does not restore contribs or manually added software, except if it's in an Ibay and instructs you to move custom-templates. Pay special attention to contribs that store files in /opt as this will not move automatically thus after remounting the old drive you may need to move the data files over after you have re-installed the contribs.
Moving from 6.x to 7.x
Summarised from http://forums.contribs.org/index.php?topic=30745.0
The following instructions were first developed when people were moving from 6.x to 7.0. At that time the templates directory had changed between versions.
- On the old SME server prior to shutting down, at the root command prompt issue the command /sbin/e-smith/signal-event pre-backup then shutdown & remove the drive
- On the new machine do a fresh install of sme7
- Shut down & install old drive and start machine.
- mkdir /mnt/tmp
- mount /dev/hdb2 /mnt/tmp (adjust "hdb2" according to where the old drive is installed).
- db configuration setprop backup Program CopyFromDisk status enabled
- signal-event pre-restore
- signal-event restore-tape /mnt/tmp (note: this step may take a long time depending on how much data is being restored
- cd /etc/e-smith
- mv templates-custom templates-custom.old
- mkdir templates-custom
- mv templates-user-custom templates-user-custom.old
- mkdir templates-user-custom
- signal-event post-upgrade
- signal-event reboot
- Shutdown and remove old drive
Copying from 7.x to 7.x
In this case your template directories and other structures should not have to change thus the the template directory changes are not needed. However SME 7 does use LVM and you will by default end up with an LVM group name conflict, thus new steps are added to rename the LVM group name on the old disk.
- On the old SME server prior to shutting down, at the root command prompt issue the command /sbin/e-smith/signal-event pre-backup then shutdown & remove the drive
- On the new machine do a fresh install of sme7
- Shut down & install old drive and start machine.
Boot from SME Server 7.x install CD
press F5
type "sme rescue" at the command prompt and hit enter
Note: don't start the network and skip mounting the filesystem. If you are on a newer board the disk may show up on /dev/sdx so the reference to hdx2 should be changed to sdx2; where you need to change "x" to the appropriate letter to match the the disk.
Note: when you do the "lvm vgscan" the LVM name should be "main" thus the value "orig_vg_name" should be "main". If it is different then use the appropriate LVM name.
mdadm -AR /dev/md5 /dev/hdx2 lvm vgscan lvm vgs -v lvm vgchange -a n lvm vgrename orig_vg_name new_vg_name exit
Now remove the CD and reboot. In most cases you won't need the mdadm, vgscan, vgchange commands below but they won't hurt. If you get an error with mdadm in regards to md5 being busy it is likely because your drive was automatically mounted. If the mount command works and you can see your data on it then it worked.
NOTE: don't forget that "new_vg_name" references below should be whatever you used above.
mdadm -AR /dev/md5 /dev/hdx2 vgscan vgchange -a y new_vg_name mkdir /mnt/old mount /dev/new_vg_name/root /mnt/old
- db configuration setprop backup Program CopyFromDisk status enabled
- signal-event pre-restore
- signal-event restore-tape /mnt/old (note: this step may take a long time depending on how much data is being restored
- signal-event post-upgrade
- signal-event reboot
- Shutdown and remove old drive
Reference information
Additional tips from http://forums.contribs.org/index.php?topic=39892.0 which refers to http://forums.contribs.org/index.php?topic=37686.0
The original disk will not mount due to volume group name conflicts with the existing drive(s). Follow this procedure to rename the volume group on the original disk:
Boot from SME Server 7.1 (or newer) install CD
press F5
type "sme rescue" at the command prompt and hit enter
Note: don't start the network and skip mounting the filesystem.
mdadm -AR /dev/md5 /dev/hdx2 lvm vgscan lvm vgs -v lvm vgchange -a n lvm vgrename orig_vg_name new_vg_name exit
Now remove the CD and reboot
mdadm -AR /dev/md5 /dev/hdx2 vgscan vgchange -a y new_vg_name mkdir /mnt/tmp mount /dev/new_vg_name/root /mnt/tmp
You should now be able to view all your old data under /mnt/tmp
Follow the steps listed above to use CopyFromDisk to restore the data.