© 2009 marky-b Pink Fantasy

Copying PerfMon Counters from Windows Server 2003 to 2008

A few weeks ago, I assisted in a performance monitoring server upgrade from Windows Server 2003 to Server 2008.  Much of the migration was fairly straightforward, however when we got to copying over the Performance Counters we ran into some issues.

Pre-Server 2008, a simple right-click on the counter and left click on “Save Settings As…” would pop up a dialog to save the counter’s settings to an .html file.  There is, however no way to import that saved .html into Windows Server 2008.

Instead, you must use the Logman.exe from the (or any) 2008 server to first export the 2003 settings remotely to a local .xml, and then import that .xml using the very same tool.  Logman.exe is located in the C:\Windows\system32 directory.

Here is an example of a couple of the commands we executed:

First, we need to navigate to the directory containing Logman.exe.

cd c:\windows\system32

Next, we’ll take a look at Logman.exe.  You can view proper syntax by typing

logman /?

We’ll be focusing on the export and import switches. with the following syntax:

logman export -s Server2003 -n CPUmon -xml Server2003_CPUmon.xml

You can see above that i throw in three arguments after the export command.

  • -s Server2003 tells Logman that we are looking at the server with host name ”Server2003″
  • -n CPUmon tells Logman that the Performance Counter we’re looking to export from the 2003 server is named “CPUmon”.  This is not case sensitive, so if you have a lot of counters to migrate, and you don’t feel like getting specific, feel free to type in all one case (your preference!).
  • Finally, -xml C:\Server2003_CPUmon.xml tells Logman that we’re looking to export all those settings into an xml named “Server2003_CPUmon.xml” located in the root C:\ drive.

When you execute the command successfully, Logman will reply with “The command completed successfully.”  Pretty straight forward.

So now that you have all of your Performance Monitoring Counters exported, it is time to fire off some import commands.

To import the command is almost identical as the export.  If you’re looking to import to the machine you’re running the commands from, then your syntax will look like this:

logman import -n CPUmon -xml C:\Server2003_CPUmon.xml

The arguments here are the same as before.

  • -n CPUmon specifies the name of the counter.  Whatever you enter here will become the name of the counter on the 2008 machine.  Though, I should note, this time it is case sensitive.
  • -xml C:\Server2003_CPUmon.xml tells Logman where to actually look for the Performance Counter settings.

Needless to say, both of the above arguments are required.

Now, if you’re looking to create a counter on a remote 2008 server, you would just add in that same -s [ServerHostName] that we used in the export command, like so:

logman import -s Server2008 -n CPUmon -xml C:\Server2003_CPUmon.xml

That’s it.  You can also find some more information about the export and import commands by typing

logman export /?
logman import /?

And if you’re more of a cmd guy, like myself, then you’ll probably want to stick to starting and stopping the counters on the 2008 server from the command prompt.  You’ll end up saving a lot of time over right-clicking your life away in the GUI.  I’ve also noticed that the GUI is pretty unstable once you get up over 10 or so counters.  Kind of ironic for the Reliability and Performance Monitoring tool.

Don’t forget to check your security credentials once they’re setup!

Photo by BluebirdMarie

12 Comments

  1. Matt
    Posted September 2, 2009 at 5:32 pm | #

    Hey, thanks for posting this – I had to move a bunch from 2003 to 2008 and didn’t realize until I was into it that I couldn’t just save as and import. Your post was really helpful!

    Matt

  2. Posted September 11, 2009 at 10:13 am | #

    Glad I could help. Theres a surprising lack of information on this topic across the internet.

  3. B-rad
    Posted September 11, 2009 at 11:03 pm | #

    Windows Server 2005? It must be the new version of Windows server 2004. At any rate good info and will be useful in the near future.

  4. Posted September 11, 2009 at 11:08 pm | #

    2004? we’re both wrong :S
    I meant 2003 through the entire post. Edited.

  5. Posted September 25, 2009 at 8:11 pm | #

    Hey! Racial humor! Thanks, Internet!

  6. Posted September 27, 2009 at 8:13 am | #

    Very Interesting post! Thank you for such interesting resource!PS: Sorry for my bad english, I’v just started to learn this language

  7. Lev
    Posted February 18, 2010 at 6:01 am | #

    Thanks man, it was really helpful!

  8. Posted August 5, 2010 at 7:38 am | #

    I recently decided to produce a simple movie about this, I would be pleased if you would maybe take a minute to watch it and possibly leave a message about what you think, I left the video link in the “website” field, hopefully you can get to it, thanks a lot

  9. Posted August 5, 2010 at 9:12 am | #

    i find this blog anagin via big g! good artical,think u!

  10. Posted August 5, 2010 at 4:44 pm | #

    I Like You – Tekbuz.com.

  11. Posted August 5, 2010 at 7:30 pm | #

    I recently decided to produce a short video about this, I would be honored if you would possibly take a moment to watch it and possibly leave a message about what you think, I left the video link in the “website” field, hopefully you can access it, thank you greatly

  12. Posted August 6, 2010 at 5:38 pm | #

    I found your entry informative so I’ve added a Trackback to it on our blog.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">