How to migrate User Links / My links from sharepoint 2007 to 2010 using SQL query

Posted by Leszek Polnik | Posted in , , , | Posted on 01:26

0

I have to migrate User links during migration to new SharePoint 2010 farm.
UserLinks table in SQL is pretty simple so i decide to use below SQL script. Remember that you do any changes in SQL db on your own risk!

I migrated SSP database to new SQL where SharePoint 2010 dbs resides and launched below script.


DECLARE
       @Old_RecodID bigint,
       @NT_Name NVARCHAR(400),
       @New_RecordID bigint
       
DECLARE UserLink_cursor CURSOR FOR

SELECT ssp.[RecordID] OldRecodID
      ,SSP.[NTName]
      , prof2020.[RecordID] NewRecordID
       FROM [SSP_DB_Intra2007].[dbo].[UserProfile_Full] SSP
     inner join   
       [UserProfiles-Profile-2010].[dbo].[UserProfile_Full] prof2020
       on 
       SSP.[NTName]=prof2020.[NTName]


OPEN UserLink_cursor;

-- Perform the first fetch.
FETCH NEXT FROM UserLink_cursor into @Old_RecodID, @NT_Name, @New_RecordID

-- Check @@FETCH_STATUS to see if there are any more rows to fetch.
WHILE @@FETCH_STATUS = 0
BEGIN
   -- This is executed as long as the previous fetch succeeds.
   
   INSERT INTO [UserProfiles-Profile-2010].[dbo].[UserLinks]
           ([RecordId]
           ,[Title]
           ,[GroupType]
           ,[GroupTitle]
           ,[Url]
           ,[ContentClass]
           ,[PolicyId]
           ,[ItemSecurity]
           ,[PartitionID])
     SELECT 
       [RecordId] =@New_RecordID
      ,[Title]
      ,[GroupType]
      ,[GroupTitle]
      ,[Url]
      ,[ContentClass]
      ,[PolicyId]
      ,[ItemSecurity]
      
     -- check partition ID from your 2010 farm querying UserLinks table in db. It will be like the following 'xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx'.
      , '0C37852B-34D0-418E-91C6-2AC25AF4BE5B' 

  FROM [SSP_DB_Intra2007].[dbo].[UserLinks]
  where RecordId=@Old_RecodID
  
   
   FETCH NEXT FROM UserLink_cursor into @Old_RecodID, @NT_Name, @New_RecordID;
END

CLOSE UserLink_cursor;
DEALLOCATE UserLink_cursor;
GO


 --select * from [UserProfiles-Profile-2010].[dbo].[UserLinks]


Reference:
http://blogs.technet.com/b/meamcs/archive/2012/05/14/migrate-sharepoint-2007-my-links-to-sharepoint-2010.aspx

         

Troubleshooting Distributed cache with Sharepoint 2013

Posted by Leszek Polnik | Posted in , , , | Posted on 03:21

0

Troubleshooting distributed cache issue:

 1. Export XML config file and compare HOSTS settings with local configurations: http://appfabricadmin.codeplex.com/ - you can use this tool to export XML and review all settings. Exporting cluster settings is also available by powershell.

Compare exported configuration (XML) with “DistributedCacheService.exe.config” in
“C:\Program Files\AppFabric 1.1 for Windows Server\” location

Exported values from cofnfigDB to XML must contain same values as in DistributedCacheService:

 - Correct entries in DistributedCacheService.exe.config according to XML exported before

 2. Check registry for connection string in APPfabric:
 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppFabric\v1.0\configuration

 3. Gracefull stop of app fabric on faulty server:
Stop-SPDistributedCacheServiceInstance –Graceful

4. Start distributed cache by powershell
$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"
$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Provision()

Warning: DON’T USE SHAREPOINT CA to start DISTRIBUTED CACHE, because it will break service again!!! 

Sources:
http://technet.microsoft.com/en-us/library/jj219613.aspx http://blogs.technet.com/b/uktechnet/archive/2013/05/07/guest-post-distributed-cache-service-in-sharepoint-2013.aspx
http://blogs.msdn.com/b/besidethepoint/archive/2013/03/27/appfabric-caching-and-sharepoint-2.aspx