Copy SQL Data into datalake
# help-with-other
e
Hello all, Our Umbraco has an underlying SQL server and I need to get that data copied in our datalake in readable relational data so the data can be used in Power BI reporting. At this moment I have an issue that some of the data seems to be stored in a varbinary. Trying to convert this varbinary into a string (using T-SQL) does not give the expected result: Data like: 0x92C70362CD065FC6000004B7F01D93DE0043A97265666572656E63659193A0A0AD53303135302D30312D30303037AB6C61737455706461746 (in fact much longer but limited characters in discord šŸ™‚ ) My SQL statement: SELECT CONVERT(VARCHAR(100), [dataRaw]) FROM [dbo].[cmsContentNu] Result: ’Çbƍ_Ɔ According to Umbraco there is no encryption. Using API functionality is at this point no option since we are simply trying to copy from a db to a db ... Anyone got a clue ? Many obliged !
s
That's the published cache of Umbraco.. it's a byte array.
e
Ok, that I already know... but how can I convert it... ?
s
Maybe some of this code will help, it used to decode the cache: https://github.com/warrenbuckley/Nucache.Explorer
s
I would recommend you use the Content Delivery API to get your data into another system https://docs.umbraco.com/umbraco-cms/v/13.latest-lts
e
II indeed got that remark from Umbraco, but being a db admin and budget owner, strange that you need to use API's to copy data from a SQL db to a datalake 🤪
s
You're very welcome to do all the database joins yourself, but we've already figured out the most efficient queries for you, so rely on those. That way, if the database ever changes, you don't have to worry about it. We never recommend going straight to the database, it leads to performance issues and if you only need read-only data, you shouldn't do it from the DB šŸ™‚
That said, if you really need to, you'll have to tap into your C# skills to convert byte streams to strings. It's coming out as JSON though, so.. you'll probably need even more C# skills to convert that into what you need šŸ˜…
e
thx