I would like to programatically(C#) export all properties of all my webparts from Sharepoint 2013. I have access to SP content db and I wonder whether it is possible make use of it somehow (for example deserializing [tp_AllUsersProperties]
column).
I know I can do it by creating each webpart and reading its properties but it can be a long process.
I did some research and I found that there is (but unfortunately internal) class BinaryWebPartDeserializer
. (https://pholpar.wordpress.com/2010/10/17/decoding-the-content-of-the-binaryserializedwebpart-the-theory/)
I also found this post: https://zetitle.wordpress.com/2010/08/25/how-to-read-webpart-properties-from-the-database/ but it looks far too easy. I would rather prefer to use some SP API.
Do you know any reliable idea? Anything you can recommend?
Szymon
select
query on a database. If a support case arises, the only thing you need to do for Microsoft to continue with the support case is "stop custom select queries running against the database". Another thing is that running stored procedures, which are documented is supported - read more here support.microsoft.com/en-gb/kb/841057NOLOCK
orREADUNCOMMITTED
and you'll be fine. I believe the chance of anyone adding a web part or changing its properties at the same time you are running that SQL query is quite low :) @MarceloEspinosa, one more things - its the CHANGES (not all, tho) to the database that are not supported, and not direct querying. But I would agree, there are other ways to achieve the same, which might be more appropriate. I would personally go for a PowerShell script.