jump to navigation

Free Server Imaging with WinPE Vista January 2, 2010

Posted by General Zod in Microsoft, Tech.
trackback

From time to time, the warranty on my server hardware will expire and I need to migrate a server to a new hardware set.  I wrote a procedure for this migration a couple years ago, and have been leveraging it ever since.

Today, a buddy asked for a copy of the procedure so he could migrate one of his servers to new hardware.  So I decided to abridge the procedure and share with the world.

WARNING:  Use this procedure at your own risk.  Incorrect use of some of the following steps may result in data loss.  If you have any doubt over the suitability of this procedure, then do not utilize it and seek help elsewhere.

Also, please make note that I do NOT write my procedures for the every man.  I write for the IT Professional who knows how to find his own answers and is willing to accept his limitations.  For that reason, I will not be explaining the reason behind every command detailed below.

Finally, this abridged procedure does NOT take into account every possible outcome or issue that might arise.  Use this procedure at your own risk.

Now that the disclaimer is out of the way…

You will need a WinPE Vista Boot CD and some kind of USB drive that will accommodate the disk space used by the server you want to migrate.  (The default build of the WinPE Vista OS may have difficulty recognizing some NIC cards, so these instructions are written with the idea of using a local storage solution.)

Also, your USB drive will need to be formatted with NTFS.  (If it is not NTFS, then you’ll probably receive the error message:  “Error 112: There is not enough space on the disk”, because the FAT32 has imposed a 4 GB file size limitation.)  If your USB drive is not NTFS, then you can format it as such on-the-fly.

First, you need to build a WinPE Vista Boot CD.

  1. Download the WAIK IMG from HERE.
  2. Extract the contents of the IMG file, and run the STARTCD.EXE to install the Kit.
  3. Open a command prompt.  Go to the C:\Program Files\Windows AIK\Tools\PETools\ folder.
  4. Run:  copype.cmd x86 D:\BootCD
    (D:\BootCD is the path where we’ll be staging the CD.)
  5. Open Notepad, and paste the following 13 lines of text into the file.

    [ExclusionList]
    ntfs.log
    hiberfil.sys
    pagefile.sys
    "System Volume Information"
    RECYCLER
    Windows\CSC

    [CompressionExclusionList]
    *.mp3
    *.zip
    *.cab
    \WINDOWS\inf\*.pnf

  6. Save the text file as D:\BootCD\ISO\Wimscript.ini
  7. Copy the contents of the C:\Program Files\Windows AIK\Tools\x86\ folder into the D:\BootCD\ISO\ folder.
  8. Return to the command prompt, and run:
    OSCDIMG -bD:\BootCD\etfsboot.com -n -o D:\BootCD\ISO cd.iso
  9. Burn a CD with the new C:\Program Files\Windows AIK\Tools\PETools\cd.iso.

Next, we’re going to prepare for the migration by performing these steps:

  1. Setup your destination hardware.  Try to mount it in close proximity to the original server so that you can reuse the cabling, if necessary.  I’d highly recommend this for convenience, especially if your server is SAN-attached.
  2. If the server is SAN-attached, label both the HBA cards and the fiber cables so you’ll be able to re-match them to each other later.
  3. Verify the local Administrator password on the Source server.
  4. Delete any unnecessary files from the Source server.
  5. Document the IP address of Source Server.
  6. Document each Partition (including Drive Letter, Volume Label, and Used & Total Disk Size).  Such as:

    C: (Boot) – 12 out of 18 GB
    D: (Data) – 44 out of 72 GB

  7. Document any Services that will need to be stopped prior to beginning the transfer. If addition to any services you have selected, I recommend that you stop the following services:

    Automatic Updates
    HTTP SSL
    IIS Admin Service
    Print Spooler
    Task Scheduler
    World Wide Web Publishing Service
    Any Anti-Virus, Backup, or hardware specific services.

  8. Configure the disk array(s) on the Destination Server.
  9. Run CHKDSK /F against each partition on the Source server, and set them to run on next reboot.
  10. Apply any outstanding Windows updates.
  11. Reboot the server.

Now, it’s time to start the migration.

  1. On the Source server, stop each service (that you’ve selected above) and set them to Manual startup.
  2. Remove the Server from the Domain.
  3. Shutdown the Server.
  4. If SAN-attached, then remove the HBA cards from the Source server and install them in the Destination server.  (Do NOT attach the fiber yet.)
  5. Boot the Source Server off of the WinPE CD.
  6. Insert the USB drive that we’ll refer to as your “Images” drive.
  7. Run the Commands:

    DISKPART
    LIST VOLUME
    EXIT

  8. Document the current drive lettering for each partition. You can cross reference the Volume Labels (documented above) for confirmation.  Also, note the lettering for your CD-Rom and the Images drive.  Such as:C: (Boot) = C:
    D: (Data) = D:
    CD-Rom = E:
    Images = F:
  9. Change to the CD-Rom drive.
  10. Use ImageX to capture images of the Source Server’s partitions into WIM format.
    Syntax: IMAGEX [flags] <source drive> <destination path> “<description>”

    /CAPTURE flag captures a volume image from a drive to a WIM file.
    /BOOT flag marks the volume image as bootable.
    /COMPRESS <fast|maximum|none> flag selects the compression type for the image.
    /VERIFY flag confirms the contents of each WIM file.

    Examples:
    IMAGEX /BOOT /COMPRESS NONE C: G:\d.wim “C”
    IMAGEX /COMPRESS NONE D: G:\d.wim “D”

  11. Eject the WinPE CD.
  12. Remove the USB drive containing your images.
  13. Shutdown the Source Server.

Now, we’re going to put the image onto your destination server.

  1. Move any NIC and Fiber cables from the Source to the Destination Server, but do NOT plug them in yet!
  2. Boot the Destination Server to the WinPE CD.Note:  I’m not going to explain every command used in the sections to follow.  I’m going to assume that you have a clue, and can figure out what they do on your own.  If not, then I recommend Google… or even better, call someone else from your IT staff to assist you.
  3. Create the Primary Disk array, and configure it to be bootable.

    DISKPART
    LIST DISK
    SELECT DISK 0
    CLEAN
    CREATE PARTITION PRIMARY SIZE=<size in MB>
    SELECT PARTITION 1
    ACTIVE
    FORMAT FS=NTFS LABEL=”<volume label>” QUICK

  4. Configure any addition partitions on the Destination Server’s Disk Arrays.

    SELECT DISK 1
    CLEAN
    CREATE PARTITION PRIMARY SIZE=<size in MB>
    SELECT PARTITION 1
    FORMAT FS=NTFS LABEL=”<volume label>” QUICK

  5. Run: LIST VOLUME
    Cross reference the information listed with the current drive lettering to determine which WIM image should be applied to which drive letter.  It’ll probably look something like this:C: (Boot) = E:
    D: (Data) = F:
    CD-Rom = C:
    Images = D:
  6. Change paths to the CD-Rom drive.
  7. Use ImageX to deploy the images to the Destination Server’s partitions.
    Syntax: IMAGEX [flags] <image path> <image number> <destination drive>

  8. After the images have been applied to the server, then remove the Images drive and the CD-Rom disc.
  9. Perform a hard reboot of the server.
  10. Login with an Administrator account.
  11. After all of the new hardware is identified, click NO to the Reboot prompt.
  12. Go to Disk Management, and correct the drive lettering mismatches.
  13. Resolve any hardware driver issues and configuration conflicts (such as NIC teams for NICs that no longer exist).
  14. Attach the NIC cabling.
  15. Configure the TCP/IP settings.
  16. Insert the server back into the domain, and reboot.
  17. If SAN-attached, then connect the fiber cable during the reboot.
  18. Have your SAN administrator confirm that the SAN drives are attached and lettered as they were previously.
  19. Set the above mentioned Services back to Automatic startup.
  20. Reboot the server.
  21. Request that someone else confirm the Server’s functionality.

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: