European Sharepoint 2013 Hosting Blog
Articles about European Sharepoint Hosting Service
Articles about European Sharepoint Hosting Service
May 17th
As we all know, SharePoint has been evolving since 2001 from its initial release to SharePoint online and now the SharePoint Subscription edition. Every organization that has been using SharePoint for years also has/had to upgrade its version. You can upgrade or migrate the content from the old version to the newer version of SharePoint in various ways.
As we all know, SharePoint has been evolving since 2001 from its initial release to SharePoint online and now the SharePoint Subscription edition. Every organization that has been using SharePoint for years also has/had to upgrade its version. You can upgrade or migrate the content from the old version to the newer version of SharePoint in various ways.
I came across a problem of migrating folders and files from the SharePoint 2010 version to the SharePoint Subscription edition (successor of SharePoint 2019).
My requirement was simple: migrate around 0.5 million files and folders from one specific site on SP 2010 to a specific site on SPSE, retaining author and timestamps as is.
Of course, there are plenty of tools available in the market which can migrate from any old version to any new version of SharePoint. Still, it comes at the cost of thousands of dollars, which I think no one wants to spend, especially when you are a core developer.
So the first free tool that came into my mind was SharePoint Migration Tool (SPMT), but when I explored it in detail, I found out that it supports migration from on-premise versions to only SharePoint Online.
The second thought that came to mind was about site backup restore, taking site backup using a PowerShell command and restoring it to a new server. But this will not work because of the database version mismatch.
The third solution I thought about was – the database upgrade approach, taking a backup of the whole database from SQL Server 2008 R2 and restoring it on SQL Server 2019. But again, this won’t work as Microsoft recommends upgrading your databases from 2010 to 2013 to 2016 and then 2019 – that’s a very hectic process and needs many server versions to be installed on different machines.
So, the last option left was to build my tool to migrate the folders and files from one server to another.
Prerequisites to make this solution works,
We are going to create a simple console application. You can make it fancier by creating forms applications and building a nice UI. It’s up to you.
Finally, here is the C# CSOM code; First, get all the folders migrated, and then migrate all the files.
If in case the tool fails for some reason, we know at which item it has failed. Observe the error, fix it at the code level, change the query with the last item ID, which was migrated successfully, and run again.
Thanks for reading! It takes hardly a few hours to build your tool to migrate the content, and in today’s world of ChatGPT, it become easier to find the exact code chunk. So don’t fall into the trap of paid tools and save the cost to your organization. I hope this will help you guys.
I came across a problem of migrating folders and files from the SharePoint 2010 version to the SharePoint Subscription edition (successor of SharePoint 2019).
My requirement was simple: migrate around 0.5 million files and folders from one specific site on SP 2010 to a specific site on SPSE, retaining author and timestamps as is.
Of course, there are plenty of tools available in the market which can migrate from any old version to any new version of SharePoint. Still, it comes at the cost of thousands of dollars, which I think no one wants to spend, especially when you are a core developer.
So the first free tool that came into my mind was SharePoint Migration Tool (SPMT), but when I explored it in detail, I found out that it supports migration from on-premise versions to only SharePoint Online.
The second thought that came to mind was about site backup restore, taking site backup using a PowerShell command and restoring it to a new server. But this will not work because of the database version mismatch.
The third solution I thought about was – the database upgrade approach, taking a backup of the whole database from SQL Server 2008 R2 and restoring it on SQL Server 2019. But again, this won’t work as Microsoft recommends upgrading your databases from 2010 to 2013 to 2016 and then 2019 – that’s a very hectic process and needs many server versions to be installed on different machines.
So, the last option left was to build my tool to migrate the folders and files from one server to another.
Prerequisites to make this solution works,
We are going to create a simple console application. You can make it fancier by creating forms applications and building a nice UI. It’s up to you.
Finally, here is the C# CSOM code; First, get all the folders migrated, and then migrate all the files.
If in case the tool fails for some reason, we know at which item it has failed. Observe the error, fix it at the code level, change the query with the last item ID, which was migrated successfully, and run again.
Thanks for reading! It takes hardly a few hours to build your tool to migrate the content, and in today’s world of ChatGPT, it become easier to find the exact code chunk. So don’t fall into the trap of paid tools and save the cost to your organization. I hope this will help you guys.
May 11th
In this blog, we will understand the use of the Call to Action web part. The “Call to Action” web part in SharePoint Online is a feature that allows you to create visually compelling and attention-grabbing content on your site’s pages. The web part can be used to promote specific actions or messages to your site visitors, such as signing up for a newsletter, downloading a document, or filling out a form.
The Call to Action Web part in SharePoint Online helps to provide a clear and compelling message to encourage visitors to take action, such as subscribing to a newsletter or filling out a form.
Apr 18th
Issue
I was recently required to use SharePoint Management shell to run some O365 PowerShell commands. But as soon as I run the SharePoint Management shell in administrative mode, I received the below error:
Could not load type ‘Microsoft.SharePoint.Client.Publishing.PortalLaunch.PortalLaunchRedirectionType’ from assembly ‘Microsoft.SharePoint.Client.Publishing, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’.
I have gone through many links that tell me to uninstall the assembly and reinstall, but I didn’t find the exact step-by-step guide. So, I am writing this blog to provide a step-by-step guide in case someone else might face such an issue.
Resolution
The reason for this error is conflicts between different versions of Sharepoint Online SDKs (SharePoint Client Components, SharePoint Online Management Shell). So correct way to solve this problem is the following:
Install the SharePoint Online Management Shell latest version from the below link:
https://www.microsoft.com/en-in/download/details.aspx?id=35588
When you start the SharePoint Online Management Shell as administrator, you will not face the error.
Apr 13th
An access key token is used to authenticate your access to Microsoft translator API. It provides secure access to Microsoft Translator API.
Here we can set up OAuth for SharePoint Online to authorize REST API calls to the SharePoint site to retrieve and manipulate the site data.
Step 1
Register an app in SharePoint.
Step 2
Navigate to https://your_site_name.com/_layouts/15/appregnew.aspx
Step 3
Click Generate for Client Id and Client Secret.
Step 4
It will ask to fill in Client Id, Client Secret, Title, App Domain, and Redirect URI.
Note. The Client’s secret key validity is one year since the creation of your Apps. We will use Powershell to update the key.
Step 5
Generate a new ClientSecret for this clientID. It uses the same clientId as set in the above step. The new ClientSecret is valid for 3 years.
1 2 3 4 5 6 7 8 9 10 11 |
$bytes = New-Object Byte[] 32 $rand = [System.Security.Cryptography.RandomNumberGenerator]::Create() $rand.GetBytes($bytes) $rand.Dispose() $newClientSecret = [System.Convert]::ToBase64String($bytes) $dtStart = [System.DateTime]::Now $dtEnd = $dtStart.AddYears(3) New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Symmetric -Usage Sign -Value $newClientSecret -StartDate $dtStart -EndDate $dtEnd New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Symmetric -Usage Verify -Value $newClientSecret -StartDate $dtStart -EndDate $dtEnd New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Password -Usage Verify -Value $newClientSecret -StartDate $dtStart -EndDate $dtEnd $newClientSecret |
Step 6
Copy the output of $newClientSecret.
Step 7
Replace the Web.config with this ClientId and ClientSecret. You don’t need SecondaryClientSecret app settings.
Step 8
Wait at least 24 hours to propagate ClientSecret to SharePoint Office (SPO)
Step 1
Open SharePoint Online.
Step 2
Put the URL ” https://your_site_name.com/_layouts/15/appregnew.aspx “.
Fill in the details,
After that, you have to click Create a button to get a confirmation screen.
Here are the steps for creating the Access key token in SharePoint online and extending the Client secret using the Powershell command.
Apr 6th
This blog post provides a comprehensive guide on using the Image Gallery Web part in SharePoint Online. With the Image gallery web part, you can showcase multiple images in a collection with a title at the top for better organization and visual appeal using various layouts such as Brick, Grid, and Carousel.
Step 1. To insert the Image Gallery web part into your Site Page, switch to edit mode by selecting “Edit” on the top right, click on the circled “+” icon, and select the Image Gallery web part from the list of available options.
Step 2. Image Gallery Web Part will be inserted under with default layout along with editing options such as Move, Edit, Duplicate, and Delete web part. To open the property pane, click on the Edit web part option.
Step 3. Click on Add Images to insert images. This will open the following default options. Select the appropriate option, insert the images, and add the title at the top if required.
Step 4. On click of Edit web part, the property pane on the right side of the screen will be displayed containing the following options.
Step 5. Layouts
The image Gallery web part includes three layouts: Grid, Brick, and Carousel.
In this layout, the caption and title can only be viewed when the image is open in full size. This layout also has the option to change the Aspect Ratio of the Images.
The SharePoint Image gallery web part allows users to rearrange images in a Grid layout and view titles and captions only when images are viewed in full size.
The Carousel layout in the SharePoint Image gallery web part displays captions and titles below the image; it does not allow for re-ordering of images but enables users to navigate through images using arrows or automatic rotation at set intervals.
Step 6. Editing the Image
Click on the image inserted in the Image Gallery. The property pane with options to edit images will be displayed on the right side of the screen. These options can be used to change the image’s title, Add a caption to the selected image, or Add Alternative Text to the image.
This is how we can use the Image Gallery Web part in SharePoint Online.
Mar 30th
Every modern page in SharePoint, by default, uses a page router(smart navigation) when a hyperlink is clicked to navigate. This behavior is intentional to avoid a complete refresh of the screen.
During development using SPFx( SharePoint Framework), smart navigation behavior might not be the expected one in all cases, as one of its consequences is using the target
attribute to open a page in a separate tab in the browser will be ignored.
Consider the following valid HTML markup, which will work outside SPFx:
Valid HTML
In the above case, the target
attribute will be ignored, and the page opens in the same tab via page router logic. To override the page router for hyperlinks, add the data-interception
attribute to the link with a value of off as shown below
.
HTML that would work in SPFx
When the link is clicked in the above example, the page will open in a new tab.
Have a nice day!!