SchumacherFM / wordpress-to-hugo-exporter

Hugo is static site generator written in golang. Wordpress is a tool for remote access to your server ;-) ❗️Contributions welcome!
https://gohugo.io
GNU General Public License v3.0
681 stars 95 forks source link

Memory allocation error when attempting export #45

Closed stephlocke closed 7 years ago

stephlocke commented 7 years ago

I've got a site with 150-200 blog posts to export, hosted on WPEngine, everything up to date version wise.

When I attempt to use the exporter (through the UI as I can't do CLI on this host) I get the following problem:


[Tue Jul 11 19:28:55.301761 2017] [:error] [pid 5633] [client XXXXXX:23529] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 207056397 bytes) in /nas/content/live/itsalocke/wp-includes/functions.php on line 346, referer: https://itsalocke.com/wp-admin/tools.php
--
[Tue Jul 11 19:28:55.315880 2017] [:error] [pid 5633] [client XXXXX:23529] PHP Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0, referer: https://itsalocke.com/wp-admin/tools.php

Is there a way I can tweak the export to keep it within 512MB memory?


PS I tried using the Jekyll exporter but that errors in it's own way.

Warning: Invalid argument supplied for foreach() in /nas/content/staging/itsalocke/wp-includes/class-wp-list-util.php on line 153

Fatal error: Uncaught exception 'Symfony\Component\Process\Exception\RuntimeException' with message 'The Process class relies on proc_open, which is not available on your PHP installation.' in /nas/content/staging/itsalocke/wp-content/plugins/jekyll-exporter/vendor/symfony/process/Process.php
SchumacherFM commented 7 years ago

This is really bad :-( No easy solution comes into my mind except ... you can export the whole WP installation as an XML file, import that XML file on your local machine and then run the Hugo exporter. There you can customize the PHP settings.

Tweaking of the exporter script is not possible ... you must completely refactor it for stream based processing.

stephlocke commented 7 years ago

Okie dokie, thanks @SchumacherFM for the quick response!