With the time passing, we might face the issue of transfering our blog files when we change our writing computer.
Here are my solutions:
1. When the target OS is the same with source OS
If you don’t want to upgrade your Hexo
version, the solution is direct and simple. First install the same version of nvm
and nodejs
, no need for those node modules or hexo themes. Then just remotely copy the whole blog files to the destination folder.
(Not suggested unless you have to) If you want to upgrade Hexo version, First install nvm, nodejs, and hexo. Then use hexo init
to create a temporary folder for storing blogs. Next git clone the blog files to the local area. cd
Then mv
the hexo init files back to upgrade relevant settings.
2. When the target OS is different from the source OS
In this situation, it is suggested to use git to synchronize contents. Ensure nvm
, npm
and node
are installed and configured. Then cd
into the blog folder and type:
1 | npm install |
to install dependencies.
Tests after migration
1 | hexo s |
Comments
shortname
for Disqus. Please set it in_config.yml
.