John
To change the URL in the database you have to run the [Framework.].[ChangeBaseURI] stored procedure and then update the basepath value in [Framework.].Parameter
The script I use for this is:
declare @newPath nvarchar(max)
select @newPath = 'http://localhost:55956'
declare @old nvarchar(max)
declare @newURI nvarchar(max)
select @newURI = @newPath + '/profile/'
select @old = value from [Framework.].Parameter where parameterID = 'BaseURI'
DECLARE @return_value int
EXEC @return_value = [Framework.].[ChangeBaseURI]
@oldBaseURI = @old,
@newBaseURI = @newURI
SELECT 'Return Value' = @return_value
update [Framework.].Parameter set Value = @newPath where ParameterID = 'basePath'
Nick
--
You received this message because you are subscribed to the Google Groups "ProfilesRNS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
profilesrns...@googlegroups.com.
To post to this group, send email to
profi...@googlegroups.com.
Visit this group at
https://groups.google.com/group/profilesrns.
For more options, visit
https://groups.google.com/d/optout.
I usually change the unique index to a regular index and then run the ChangeBaseURI job. Then I run the following query to identify duplicates.SELECT * FROM [RDF.].[Node] INNER JOIN (SELECT [ValueHash] FROM [RDF.].[Node] GROUP BY [ValueHash] HAVING COUNT(*) > 1) AS tmp ON [RDF.].[Node].[ValueHash] = tmp.ValueHash;UPDATE [RDF.].[Triple] SET [Object] = <nodeid1> WHERE [Object] = <nodeid2>;Just tested this in the dev environment and it worked great!
-Nick, can you confirm this best practice before I run it in production?
John
I think that process should work. Run EXEC [Framework.].[RunJobGroup] @JobGroup = 3 afterwards to update the cache.
I have run into the same issue a couple of times. When I have seen it, it has been caused by the nightly job updating the URLs for photos to the new url, which causes the duplicates.
In the past I have solved the issue by looking for the duplicates and removing them, and updating any triples pointing to them, then running the change URI script. I'm pretty sure that is functionally equivalent to the code Joshua sent, just performing the steps in a different order. To identify the duplicates I use:
declare @oldBaseURI varchar(1000)
declare @newBaseURI varchar(1000)
select @oldBaseURI = 'http://connects.catalyst.harvard.edu/profiles/profile/'
select @newBaseURI = 'http://dev.connects.catalyst.harvard.edu/profiles/profile/'
select * from [RDF.].[Node] a join [RDF.].[Node] b
on a.Value = @newBaseURI + substring(b.value,len(@oldBaseURI)+1,len(b.value))
Nick