|
| 1 | +--- |
| 2 | +title: Modernize classic blogs |
| 3 | +description: Modernize your classic blogs |
| 4 | +ms.date: 10/23/2019 |
| 5 | +ms.prod: sharepoint |
| 6 | +localization_priority: Normal |
| 7 | +--- |
| 8 | + |
| 9 | +# Modernize classic blogs |
| 10 | + |
| 11 | +> [!IMPORTANT] |
| 12 | +> Modernization tooling and all other PnP components are open-source tools backed by an active community providing support for them. There is no SLA for open-source tool support from official Microsoft support channels. |
| 13 | +
|
| 14 | +SharePoint started supporting blogging via a blog site template as of SharePoint 2010 and today these blog sites with their blog pages do work in SharePoint Online. The whole blog creation and publishing experience however is, compared to modern pages in modern communication sites, very outdated. We therefore recommend to use modern communication sites for your future blogging needs. If you today have blog sites with blog pages that you want to "upgrade" to modern pages in a modern communication site then follow the steps outlined in this article. |
| 15 | + |
| 16 | +## Step 1: Understand where there are actively used blogs in your tenant |
| 17 | + |
| 18 | +Before you can start modernizing your blog sites it's important to answer these questions: |
| 19 | + |
| 20 | +- Where are the blog sites in my tenant? Getting insight in the blog sites will help you assess the possible modernization impact |
| 21 | +- Which blog sites are still actively used? It makes sense to (initially) only modernize actively maintained blog sites |
| 22 | + |
| 23 | +The best approach to get an answer to the above questions in running the [SharePoint Modernization Scanner](./modernize-scanner.md): when you run this scanner you'll get a [report detailing the classic blog sites](./modernize-scanner-reports-blogs.md). |
| 24 | + |
| 25 | +## Step 2: Prepare a target communication site to receive the modernized blog pages |
| 26 | + |
| 27 | +Classic blog posts live in a list in a classic blog site, when you modernize these blog posts they'll be modern pages living in a modern site which typically is a communication site. So before you can start the modernization of a blog you'll first need to have a communication site available. Depending on your desire to copy blog metadata (e.g. blog post categories) you'll need to configure the SitePages library accordingly. |
| 28 | + |
| 29 | +### Step 2.1: Creating the communication site |
| 30 | + |
| 31 | +To create a communication site you can either use the SharePoint user interface or use [PnP PowerShell](https://aka.ms/sppnp-powershell). Using the SharePoint user interface you: |
| 32 | + |
| 33 | +- Navigate to the SharePoint Home (waffle icon top left --> SharePoint) |
| 34 | +- Click on **Create site** |
| 35 | +- Click on **Communication site** |
| 36 | +- Give the site a name and click on **Finish** |
| 37 | + |
| 38 | +When you're using [PnP PowerShell](https://aka.ms/sppnp-powershell) follow these steps: |
| 39 | + |
| 40 | +```PowerShell |
| 41 | +# Connect to a site in your tentant |
| 42 | +Connect-PnPOnline -Url https://contoso.sharepoint.com |
| 43 | +
|
| 44 | +# Create a new communication site based upon an English template |
| 45 | +New-PnPSite -Type CommunicationSite -SiteDesign Topic -Url https://contoso.sharepoint.com/sites/modernblog -Title "Blog site" -Lcid 1033 |
| 46 | +``` |
| 47 | + |
| 48 | +### Step 2.2: Configuring the communication site |
| 49 | + |
| 50 | +A classic blog post can have one or more metadata fields that you want to take over on the modern blog pages. If that's the case then you'll need to define the needed metadata fields on the SitePages library in the modern communication site. This can be done using the SharePoint user interface by: |
| 51 | + |
| 52 | +- Clicking on **Pages** in the top navigation |
| 53 | +- Clicking on the **+ Add Column** and then define the needed column(s) |
| 54 | + |
| 55 | +The most commonly used metadata field is the `PostCategory` field that's used to categorize the created blog posts. In a classic blog this is a lookup column, but in the modern blog site this should be create as a **multi-value choice field**: |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | +When you're using [PnP PowerShell](https://aka.ms/sppnp-powershell) follow these steps: |
| 60 | + |
| 61 | +```PowerShell |
| 62 | +# Connect to the communication site you created in the previous step |
| 63 | +Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/modernblog |
| 64 | +
|
| 65 | +# Add the field to the SitePages library |
| 66 | +Add-PnPField -List "SitePages" -DisplayName "PostCategory" -InternalName "PostCategory" -Type MultiChoice -AddToDefaultView -Choices "Events","Ideas","Opinions" |
| 67 | +``` |
| 68 | + |
| 69 | +## Step 3: Transform the classic blog pages into modern pages |
| 70 | + |
| 71 | +Final step in the blog modernization process is transforming the classic blog posts into modern pages. This can be done using [SharePoint Page Transformation](./modernize-userinterface-site-pages.md), which allows you to read **any** classic page (wiki, webpart, blog or publishing page) in SharePoint 2010, SharePoint 2013, SharePoint 2016, SharePoint 2019 or SharePoint Online and create the page as a modern page in SharePoint Online. In our guidance we're showing how to convert classic blog pages living in SharePoint Online to modern pages in SharePoint Online, but you could apply the same logic to transform classic on-premises blogs to modern communication sites in SharePoint Online. |
| 72 | + |
| 73 | +To run blog page transformation you do need to use [PnP PowerShell](https://aka.ms/sppnp-powershell). Below snippet shows how to convert one classic blog post in a modern page. |
| 74 | + |
| 75 | +```PowerShell |
| 76 | +# Connect to the classic blog site |
| 77 | +Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/classicblog |
| 78 | +
|
| 79 | +# Convert the blog post with title 'Financial results Q1 2019' |
| 80 | +ConvertTo-PnPClientSidePage -BlogPage -Identity "Financial results Q1 2019" -Overwrite -TargetWebUrl https://contoso.sharepoint.com/sites/modernblog -LogType File -LogVerbose -LogFolder "c:\temp" -KeepPageCreationModificationInformation -PostAsNews -SetAuthorInPageHeader -CopyPageMetadata |
| 81 | +``` |
| 82 | + |
| 83 | +Above `ConvertTo-PnPClientSidePage` cmdlet will read the classic blog page with title "Financial results Q1 2019" and create this as a modern page in the previously created modern blog site (https://contoso.sharepoint.com/sites/modernblog). The blog page transformation will: |
| 84 | + |
| 85 | +- Retain the classic blog page author, editor, create and modified information (`-KeepPageCreationModificationInformation`) |
| 86 | +- Set the classic blog page author as author in the modern blog page header (`-SetAuthorInPageHeader`) |
| 87 | +- Copy the classic blog page metadata if the same fields exist in the modern blog (`-CopyPageMetadata`) |
| 88 | +- Publish the created blog as news on the site (`-PostAsNews`) |
| 89 | + |
| 90 | +Above script snippet showed how to modernize a single blog page, but often you would want to modernize all the posts in your blog site. If that's needed then below script can be used. |
| 91 | + |
| 92 | +[!code-powershell[blogmodernization](../../sp-dev-modernization/Scripts/PageTransformation/Convert-BlogPages.ps1 "Convert blog pages into modern pages")] |
0 commit comments