Office-365-public-website-migrate

Migrate your Office 365 Public Website to a Shared Hosted WordPress site

If you have not heard yet, Office 365 is ending its support for a Public Website feature. So now you have an Office 365 Public Website, and less than two years before Microsoft shuts it down. What to do. What to do.

Well you could migrate to the suggested GoDaddy or WIX.com solutions, but I chose WordPress. Why? According to Wikipedia, WordPress has some 60 million website / blog users big and small.

And WordPress CMS market share is about 60% compared to only 0.4% for SharePoint websites. With WordPress you get a mature, robust CMS (Content Management System) that is a lot easier to set-up than you might think.

This is not for wordpress.com, but I’m talking about wordpress.org, where you can download WordPress core files and upload them to a database on a server like GoDaddy (or any server).

So, what about using WordPress? Well, Not much talk about it on the Office 365 community forum. There are no apps or plug-ins to transfer your posts / pages over to a WordPress site (or any site). In this tutorial I will show you how I migrated to a shared hosting WordPress website using copy and paste methods.

You can copy over each post at your own leisure, while still using your current O365 website. You can keep all posts in WordPress as drafts, so it won’t show on the internet until you are ready.

You also have access to the ‘ .htaccess ‘ file in the WP database to make 301 redirects for all your old O365 pages and posts. Sounding like a good idea? Keep reading!

Watch the Video

Setup a WordPress Site

To setup a WordPress website check my tutorial here. Then continue with this tutorial.

Your Domain Name

You have either these two domains for your Office 365 public website right now:

1.) The free domain when you signed up for Office 365.

http://yourname-public.sharepoint.com
or
http://yourname-onmicrosoft.com

If this is your case then decide what you want to name your new WP site and add a custom domain name when you purchase a hosting plan from a hosting provider (like GoDaddy.com). You can keep your new WP site hidden from search engines while you move over your content. All the while, your current O365 site stays public.

NOTE: If you are using a free domain name for your O365 site, then skip step 2.

 

2.) Or a custom registered domain name you bought from a domain provider (like GoDaddy.com).

http://www.yourwebsite.com

If this is your case then all you need to do is add a hosting plan with that name. Go to the ‘Setup a WordPress Site’ link above to create your new WordPress site.

If the domain provider does not have hosting plans that you like, then find another hosting provider you do like. But you can keep your domain name where it is.

During your migration, you want to keep your current Office 365 site up and running. To do this, your registered domain name must stay pointed to your O365 site. You can check and make sure by going to your domain registrar (like GoDaddy) and checking the Nameservers for your domain name. They should have something like the names below.

NS1.BDM.MICROSOFTONLINE.COM 
NS2.BDM.MICROSOFTONLINE.COM

Change your HOSTS file

NOTE: When purchasing a hosting plan with your custom domain name still pointing to your Office 365 site, you can’t get access to your WP site from the web. You need to modify the hosts file on your computer. This allows you to log in to your WordPress site and start using it, and previewing each post as it would look like public on the web. See this link for more information.

For Windows computers use Notepad. Open Notepad with Run as Administrator (or you cannot save). Go to File – Open, then copy and paste the text below, into the File name. Click Open.

c:\windows\system32\drivers\etc\hosts

Then Paste your domain IP address, and a space, then your domain name on an empty line. Just like you see below. To find your IP address, log in to your Cpanel for your domain name info.

Save the text file with the IP address and WP website name. Now this hosts address above will allow you to login and use your new WP site on your computer, while your registered domain name is still pointing to your old O365 site.

NOTE: Some Hosting providers will allow for a preview mode for you to work on your new website, but talk with your host before doing this (I found out the hard way), because in preview mode (on Godaddy), you mess up all the pemalinks as you create content. Just a warning. On other hosts the preview mode might work, but call and talk to them first.

To edit the hosts file on a Mac see this link.

Start Copying over Office 365 posts to WordPress

I will just touch on the basics of using your new WordPress site to copy and paste over each post or page, as well as images and documents.

First of all I will assume you will use your current O365 site until all data is transferred. The size of your site will depend on how long the transfer will take. For me, less than 200 pages with images, took a couple months (a couple hours a day).

For simply copy and pasting, go to your O365 site and highlight all the text for a post or page and COPY.

Remove O365 markup. To remove all the html markup junk, go online to ckeditor.com and in the text editor, delete all text and images

PASTE your Office 365 page into the editor. This will clean all the unnecessary markup code in the original Office 365 page.

You can go to Source button to see the clean html. This is important before you paste into a new WordPress post.

Manually highlight all text and images and COPY.

Then PASTE into a new WP post like you see below:

O365 embedded images, documents and links

These will be in the html code on each page you paste over to your WP site. This is ok if you have lots of time before the expiration date of your O365 site (at least two years after March 9, 2015). You can use these embeds in your WP site, but you will have to replace them eventually before your O365 site is taken down (March 2017).

You can also download the images and docs for each post from O365, then upload these in the WP Image Library, replacing the O365 images or docs.

  •  To download all images, go to your browser and load your Office 365 site, go to the page you want, and in the browser go to the menu and choose Save as Webpage Complete. Where you saved the file you will see a folder with all the images. You can then upload these to your WP site. Just drag images to your WP posts.
  •  To download documents (PDFs, Zips, SWF’s etc.) from each page from Office 365, click those links and download them to your computer. Then you can upload them the same way to the WP Image Library.
  •  For all internal links, that is all links to other pages in your O365 site, keep them where they are because you can redirect them in the .htaccess file through FTP. which I will cover under 301 Redirects later in this post.
  • To see the html code in your WordPress post, click the Text button like below:

  •  The first highlight is an internal link to another post on your O365 site.
  •  The second highlight is an image link from your O365 site.
  •  The third and forth highlights are document links from your O365 site.

Remember… Image and Documents links will show in your WordPress posts just fine. But you will have to replace them before the 2017 decline.

As for internal links, continue reading to see how to make 301 redirects.

301 Redirects using .htaccess file

Do not alter your html code for internal links. After you copy and paste an Office 365 post over to WordPress, you will have to add 301 redirects to the .htaccess file through FTP.

As soon as you get your beta WP site up and running you can redirect each old O365 post in the .htaccess file of your WP site. These will be 301 redirects. So all your SEO value on your O365 pages (search engine ranking, etc) will transfer over to your new WP post permalinks. Note: It will trickle down slowly over a few months, so you may dramatically lose traffic, especially with Google search traffic, until all the SEO value of your old pages is taking into account with Google and the other search engines. Just to let you know 😐

For example, your O365 site Home Page, depending on how long you have had an Office 365 Public website, you may have up to 3 home page permalinks:

2009-2012:

http://your-public.sharepoint.com/default.aspx

2012-2013

http://your-public.sharepoint.com/Pages/default.aspx

2013… friendly url

http://your-public.sharepoint.com/latest-posts

In your WP site, your permalinks will look different. To set them, go to Settings > Permalinks. Set to Post Name, the recommended and friendly permalink structure.

 

Now your WP home page will be something like:

http://www.yourwebsite.com/latest-posts

Now to redirect all the old home pages, you will need to open Filezilla, and go to the public_html folder of your new WordPress site. Inside this folder is your .htaccess file. One use of this file is to add 301 redirects (so all your old links go to the new WP permalinks).

So with the home page in mind, right click on .htaccess and View / Edit. The file at first will look something like you see below:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Syntax for 301 Redirects in .htaccess:

[redirect 301][space][/old O365 address][space][new WP address]
redirect 301 /Pages/default.aspx http://www.tutorialboneyard.com/

To add redirects for your home page like I did for mine see below (add to blank spaces below # END WordPress):

#TBY Home 301s
  redirect 301 /Pages/default.aspx http://www.tutorialboneyard.com/
  redirect 301 /default.aspx http://www.tutorialboneyard.com/
  redirect 301 /latest-tutorials http://www.tutorialboneyard.com/
#END Home 301s

Now I chose my home permalink to be my domain name. Follow these steps to make your own:

Here is an example. Enclose your redirects in a hash name like below:

#YOURWEBSITE Home 301s
  redirect 301 /Pages/default.aspx http://yourwebsite.com/latest-posts
  redirect 301 /default.aspx http://yourwebsite.com/latest-posts
  redirect 301 /latest-tutorials http://yourwebsite.com/latest-posts
#END Home 301s

As you finish pasting over each post from O365 to WP, add a 301 redirect. Example below:

#YOURWEBSITE Articles 301s
  redirect 301 /Pages/article1.aspx http://yourwebsite.com/article-1
  redirect 301 /article1.aspx http://yourwebsite.com/article-1
#END Articles 301s

Note: some of your Office 365 site pages may have more than one suffix like below:

http://your-public.sharepoint.com/newpost1.aspx
http://your-public.sharepoint.com/Pages/newpost1.aspx
http://your-public.sharepoint.com/newpost-1

Make sure you get all address versions for each page.

Note: You will find these easily in search engine webmaster tools like Google. You have to make an account with them. Webmaster tools will eventually show any internal or external links that you missed putting a 301 redirect on. So keep this in mind.

Ok, continue transferring all O365 site posts over to WP. Add 301 redirects, and test your links in preview or online to see if the 301’s are working.

Going Live

If you are using a default domain name with your Office 365 public site, then skip the steps below.

When you are done migrating your Office 365 site to your new WordPress site, it is time to:

1.) reset nameservers for your domain name (only if you are using a custom domain name pointing to your O365 site).

  • Go to your domain name account under name settings. Under nameservers, you should still see that it points to Microsoft.
NS1.BDM.MICROSOFTONLINE.COM
NS2.BDM.MICROSOFTONLINE.COM
  • To remove the these old nameservers, you will find a Manage link. Click it and you will go to Nameserver Settings. Note: this may look a bit different depending on your Host Provider.

 

  • The Microsoft names will be under Custom settings. Going back to Standard, you should find your original nameserver names. If not, call your host provider to get your original names.

Note: things may look a different depending on your Host Provider.

 

2.) remove your registered domain name for O365

  • From your Office 365 admin, go to Manage Public website. As you can see below I already removed my custom domain name. To remove yours, Click Change address. Now select your default address (yourname-public.sharepoint.com or yourname-on.microsoft.com). You can use this site as a back-up for all your original posts

 

3.) Go to Domains, and remove your custom domain name. Below I have already removed mine, leaving the default active:

 

4.) Go back to your hosts text file and delete the ip and website name you entered earlier. If you don’t, it might cause some problems Recheck this link.

5.) Now it may take anywhere from an hour to a few days before your WP site shows on the internet. Until then you will not be able to log-in. So sit tight.

6.) If after a few days you have not got access to your WP site, then review the steps above to see if you have made any mistakes. If you need further help send a comment to me in this post at the bottom, I will try to help you. If the situation is a mess it’s time to contact your domain name provider and ask for assistance.

Hide your old site from search engines

  • Finally, you need to go to Manage public website settings or Site settings for your O365 site.

  • Under Site Settings, find Search Engine Sitemap Settings.

  • You need to add a ‘ Disallow: / ‘ to make search engines stop indexing your old site pages. This will trickle down over a few months. This is important, because you do not want to have duplicate content indexed on the search engines. This may affect you WP site rankings in searches and drop your overall traffic temporarily.

Trouble-Shooting

There are still some things to clean up if you have any images:

  • Images on O365 might have the width and height in a style like below.
<img src="https://your-public.sharepoint.com/folder1/image1.png" style="height:366px; width:693px"/>

I have found if you use a responsive theme for your WP site, and go to your mobile devices, the images with the style widths are skewed disproportionally. So, remove the height and width from these styles to avoid image problems on mobile devices.

 

  • external linked images on Google Plus and FaceBook do not load

I have found that many images that were hot-linked to my social pages did not load. This was a real mess for me. Do not hotlink images from your site to any other site. Anyway I had to redo my social posts and uploading the images to their servers instead. Hot-linking images can slow a website down.

 

Add this page to your Website, Blog, or Forum. Let your friends know about this tutorial: Add the following html code: <a href= “http://www.tutorialboneyard.com/office-365-migrate-to-wordpress/” target=”_blank”>Office 365 Migration to WordPress</a>

Share this Page with Friends:

Leave a Reply

Your email address will not be published. Required fields are marked *