Finally got round to migrating from the old WordPress site at statto1974.wordpress.com to an all new shiny site using Hexo hosted as a static site in Azure Storage from wutek.co.uk
It was a “fairly” painless process.
Setting up the site with Hexo
Make sure you’ve got Node.js and Git installed.
Install Hexo with the following command1
$ npm install -g hexo-cli
Run the following commands1
2
3$ hexo init <folder>
$ cd <folder>
$ npm install
Migrate posts and media
- On the WordPress site dashboard, go to Tools > Export
- Click on Export All, download the ZIP file and extract to a folder
Install the hexo-migrator-wordpress plugin1
$ npm install hexo-migrator-wordpress --save
Run the following command1
$ hexo migrate wordpress <source>
Where source is the file path or URL to the WordPress export file.
You’ll need to do some tidying up of the posts and linking images
Publishing to Azure
Once you’re happy with the posts, you need to generate the static site in Hexo1
$ hexo generate
Publish the public
folder to Azure Storage in Visual Studio Code (You’ll need to have the Azure Extension installed)
- Right click the
public
folder - Select the Deploy to Static Website…
- Select a storage account or create a new one
- Enable static website if requested
- Wait a while for files to upload
- When finished you’ll be shown the site link