Getting Url from node from old database
# help-with-umbraco
a
I've exported/imported all content (Usync Migrations) from an old Umbraco (V6), however I just found out most url's that are in text, contain
'localLink:41241'
. Plain old Id's.. We need guids now 😉 How can I reconstruct the urls for these links? I currently only have the DB running for it. In my new application I already made a script that checks if localLink exists, and can replace the
hrefs
if it encounters it (first checking if the url also currently exists). Only I have no idea how I can get the correct url from the old database. I've tried using some SQL, but the returned url's dont seem consistend (sometimes extra paths are added, but perhaps my sql is off). Anyone an suggestion on what is the easiest way to fix this ? Else I might need to write something that can output some xml/json with the Id's and url, and then write a script toimport them in the new.. But trying to get the old one running again is... meh 😉
Ok made it 'easy' Booted up a empty V6 solution, connected it to the DB, made a controller that outputs a json and the id/url Wrote some code to scout through all block-content of type text, find hrefs with 'localLink', strip the id, used the json to find the url, used the Content.GetByRoute(url), to get the current Guid, and replaced the id with the guid... Seems to work 😄
m
You could also do this with a Property Value Converter that wraps the core property value converter. I guess that the "right" solution is to migrate away from the numeric int-based ids towards UDIs.
a
Ye the main problem was that in the old database the id's had different numbers, so they wouldnt match in the new database anyway, so had to map them somehow
only had to check 20 out of 2000 links manually 😄
5 Views