Can profiler templates be migrated to newer versions of SQL Profiler?
Asked Answered
V

2

13

Is it possible to migrate Profiler templates to newer versions of SQL Server?

In my case I want to take my SQL 2008 templates to 2012. I've tried (1) a straight file copy and (2) an export/import. In both cases the older templates run, but cannot be modified. Modifications result in the following error:

Error message when editing upgraded template

I've got a bunch of custom templates and I'm trying to avoid recreating them by hand. Although, I guess that is the fallback position. Thoughts?

Vimineous answered 21/9, 2012 at 21:36 Comment(0)
P
4

Export the template from SQL Server 2008's version of Profiler (I assume you have already done that).

Now open 2012 Profiler, go to File > Templates > Import and choose your .tdf file.

You will have a new user trace template with the name [filename] (without the .tdf). Go to File > Templates > Edit and pick the trace template you imported. You should then be able to edit the server type by pulling the dropdown : enter image description here

Then you can save the template and that should be the server type when you start a new trace using that template. When you pick the different server type, the template name disappears, but if you save it does edit the selected template.

Note: this all taken from a previous question on dba.stackexchange.com.

Penn answered 21/9, 2012 at 21:47 Comment(6)
Upon closer inspection, the template name is blanked out (as you stated), but when hit save (or save as) an error message states "Please select an existing template name first."Vimineous
@Vimineous hmm, you may have to select it again? Anyway you should probably be embracing extended events, or at least using server-side trace instead of profiler. :-)Penn
I agree with server-side tracing or extended events for anything where weight matters. For day to day development, however, I'm not quite ready to give up my Profiler:-)Vimineous
Had problems with this in SQL 2014. When I selected 2014, the list of templates was reset; I immediately hit save, and when I opened the new trace it was just ye olde standard default trace. For quick n dirty I used @user1720293's work-around. Extended Events is the future, but I sure hate having to relearn everything Microsoft every few years.Zootechnics
I had to use the alternate answer from @mcw0933 in the previous question on dba.stackexchange.com. (see Note in the question above)Hellbent
in Sql Profiler 2017 they change the name to the last known user defined profile so you cannot save it without overwriting the existing. bummerInotropic
I
10

Yes, I managed to move mine from 2012 to 2014.

Export from 2012. Import into 2014.

At this stage the new template will only run agains 2012 instances of SQL Server, and not your local 2014 one.

Ensuring profiler is closed, you need to go to explorer and copy the file from the folder representing 2012 templates to the 2014 one:

C:\Users\YOURUSERNAME\AppData\Roaming\Microsoft\SQL Profiler\12.0\Templates\Microsoft SQL Server\120

Innovation answered 21/8, 2014 at 11:59 Comment(2)
This worked for me, though I'm not sure I entirely trust it.Zootechnics
Still ended up doing it manually like this for SQL 2017. Into the 14.0 and 140 folders instead.Innovation
P
4

Export the template from SQL Server 2008's version of Profiler (I assume you have already done that).

Now open 2012 Profiler, go to File > Templates > Import and choose your .tdf file.

You will have a new user trace template with the name [filename] (without the .tdf). Go to File > Templates > Edit and pick the trace template you imported. You should then be able to edit the server type by pulling the dropdown : enter image description here

Then you can save the template and that should be the server type when you start a new trace using that template. When you pick the different server type, the template name disappears, but if you save it does edit the selected template.

Note: this all taken from a previous question on dba.stackexchange.com.

Penn answered 21/9, 2012 at 21:47 Comment(6)
Upon closer inspection, the template name is blanked out (as you stated), but when hit save (or save as) an error message states "Please select an existing template name first."Vimineous
@Vimineous hmm, you may have to select it again? Anyway you should probably be embracing extended events, or at least using server-side trace instead of profiler. :-)Penn
I agree with server-side tracing or extended events for anything where weight matters. For day to day development, however, I'm not quite ready to give up my Profiler:-)Vimineous
Had problems with this in SQL 2014. When I selected 2014, the list of templates was reset; I immediately hit save, and when I opened the new trace it was just ye olde standard default trace. For quick n dirty I used @user1720293's work-around. Extended Events is the future, but I sure hate having to relearn everything Microsoft every few years.Zootechnics
I had to use the alternate answer from @mcw0933 in the previous question on dba.stackexchange.com. (see Note in the question above)Hellbent
in Sql Profiler 2017 they change the name to the last known user defined profile so you cannot save it without overwriting the existing. bummerInotropic

© 2022 - 2024 — McMap. All rights reserved.