iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🚚

Exporting WordPress on Lolipop for Hugo Migration

に公開

I attempted to migrate my blog system from WordPress to Hugo. First, I installed the wordpress-to-hugo-exporter plugin in WordPress and tried to export, but it didn't go well.

The exported hugo-export.zip was corrupted and could not be opened.

I tried "WordPress to Jekyll Exporter" as an alternative, but the situation was the same. However, since I noticed a memory allocation error notification this time, I decided to SSH into the VPS and execute hugo-export-cli.php directly.

cd web/huga/wp-content/plugins/wordpress-to-hugo-exporter-2.0.1

Moving to the directory and running:

php hugo-export-cli.php

resulted in:

Your server is running PHP version 5.5.35 but WordPress 6.0.1 requires at least 5.6.20

???

Although I had updated PHP via the Lolipop management console, the path in the SSH environment was still pointing to 5.5.35, so I'll switch it.

$ echo export PATH='/usr/local/php/7.1/bin:$PATH' >> ~/.bash_profile

$ source ~/.bash_profile

$ php -v
PHP 7.1.5 (cli) (built: Jul 10 2017 18:03:20) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.5, Copyright (c) 1999-2017, by Zend Technologies

Now that it has switched to PHP 7.1.5, I'll run it again.

php hugo-export-cli.php

$ php hugo-export-cli.php
[INFO] tmp folder not found, use default. You could invoke php hugo-export-cli.php with an extra argument as the temporary folder path if needful.
This is your file!
/tmp/wp-hugo.zip

It succeeded.

Discussion