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

The multi-part identifier "UserData.tp_ID" could not be bound.

Posted by Michał Juśkowiak | Posted in | Posted on 02:26

0

Source: Windows SharePoint Services 3
Event ID: 5586
Error: 

Unknown SQL Exception 4104 occured. Additional error information from SQL Server is included below.
The multi-part identifier "UserData.tp_ID" could not be bound.
ORDER BY items must appear in the select list if SELECT DISTINCT is specified.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

When you see this kind of error you can be sure that one of your lists reach magic level of 500 items.
So the guestion is : which one ? This is a big problem when your enviroment has tousends of them.

First you need to check SharePoint log because there is answer.
1) ConnectionString: 'Data Source=InstanceName;Initial Catalog=DBName;Integrated Security=True;Enlist=False;Connect Timeout=15'

Hint for DB name

2) Parameter: '@DN' Type: NVarChar Size: 260 Direction: Input Value: 'sites/ABC/newpost/Lists/abc'

So when we knew the name of list we can check how many items are there :






As you see we have 506 items . When you try to choose "Show Filter Choices" you will see:




Ok so how we can fix it ?

We can try install the WSS Cumulative Update from June 30, 2009. In my opinion this won't help. The second option is to remove \ close \ move some of items. I can bet that after second step eveything will back to normal.

SharePoint 2010 World: ADAM-Forms Based Authentication in SharePoint 2010...

Posted by Leszek Polnik | Posted in | Posted on 01:28

0

SharePoint 2010 World: ADAM-Forms Based Authentication in SharePoint 2010...: Basically Forms Based Authentication is a part of ASP.NET. So, it supports in all versions of SharePoint which are released after ASP.NET 2...

How change layout of AccessDenied.aspx site

Posted by Leszek Polnik | Posted in | Posted on 04:27

0

If You want branding AccessDenied.aspx (_layouts) site You should make modifications in "simple.master". Like most master pages, the simple.master controls the look and feel or more than just a single page. In fact, it controls the look and feel of seven pages in the _layouts folder:

 "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS

 AccessDenied.aspx

Confirmation.aspx

Error.aspx

Login.aspx

ReqAcc.aspx

Signout.aspx

Webdeleted.aspx


 Any changes could have impact to application level or for one site collection only.

Precisely how to change "simple.master" and contraindications are written in Microsoft article. Please see here:

http://support.microsoft.com/kb/944105/en-us

Content Query Web Part - RSS feed not working on non publishing site

Posted by Leszek Polnik | Posted in | Posted on 07:45

0

Our client created site collection with using Team Site template and later they want some extra features. Therefore they activated “Office SharePoint Server Publishing Infrastructure” feature and add to root site Content Query Web Part with RSS feed enabled. But when they gave click on RSS feed button they recived below error:

 
Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). at System.Guid..ctor(String g) at Microsoft.SharePoint.Publishing.Internal.CodeBehind.FeedPage.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 

Http Error 401.1 error when accessing MOSS 2007 site from Web Front End

Posted by Michał Juśkowiak | Posted in | Posted on 04:53

0

When you've finished configure all farm settings after new installation check if your web applications are accessible from your's Web Front Ends. If you receive below error:
"HTTP Error 401.1 – Unauthorized: Access is denied due to invalid credentials" don't be sad, because Microsoft have two solutions for this type of issue. I have always use method 1.

How to move content database to new disk

Posted by Michał Juśkowiak | Posted in | Posted on 04:31

0

Prerequisite

The URL of the application will be the same after content moving
There is no infrastructure changes during the backup and restore process

 

The essential steps of the content db moving

1.Site collection backup

The stsadm command which make the backup is the following:
stsadm -o backup -url <site collection url> -filename <backup filename>

 

Script which automatically unlock site collection - Sharepoint powershell

Posted by Leszek Polnik | Posted in | Posted on 04:36

0

If you need to check or unlock site collection(s) automatically you can use this script. You can also add it at the end of any stsadm backup script by adding:

  powershell.exe "& 'c:\folder\Get-SiteLock.ps1' -unlock"
 
This way it will check all site collections of all web applications for read-only locks and unlocks them if found. Post SP2 site collection backup sets the site collection as read-only during the backup but sometimes doesn't unlock them correctly after the backup.

How quickly check memory usage / status in SQL Server 2005 2008

Posted by Leszek Polnik | Posted in | Posted on 23:39

0

Run below query in SQL:
DBCC MEMORYSTATUS
Explanations of headers:
  • Memory Manager: shows overall memory consumption by SQL Server
  • Memory node Id: usage for each memory node: summary of memory usage
  • MEMORYCLERK_SQLGENERAL: aggregate for each memory node: aggregate memory
  • Buffer distribution: the distribution of 8-kilobyte (KB) buffers in the buffer pool
  • Buffer Counts: Buffer pool details from sys.dm_os_buffer_descriptors
  • Procedure cache: Size and type
  • Global memory objects: size of the global memory objects
  • Query memory objects: snapshot of the query memory usage: the workspace memory
  • Optimization Queue: summary of the users who are trying to optimize queries at the same time
  • MEMORYBROKER_FOR_CACHE: control cached memory, stolen memory, and reserved memory