Wordpress export failing

I’m in the process of testing Ghost (locally) with content migrated from a live Wordpress site.

  • All is working well for both Ghost (local) and Wordpress (local).
  • I have downloaded the rather large db ~250mb and assets ~20GB. Importing into my local Wordpress has worked (using Local App - very impressed how simple this was).
  • I’ve cleaned up a few posts, removed the old tags and changed categories into tags.

Now I’m up to the process of exporting from Wordpress to Ghost using the Ghost migration plugin for Wordpress.

Ghost Migrator 1.1.0 - Diagnostics

PHP version: 7.4.1.
PHP ZipArchive Installed: Yes
Memory Limit: 256M
Max Execution Time: 1200

The error I receive when trying to export the JSON is as follows;

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /Users/shawnsmith/Sites/trizonelocal/app/public/wp-includes/meta.php on line 1190

Any suggestions/tips?

You’ll need to edit php.ini and increase memory_limit, then restart the web server. The location of the file varies according to OS, PHP config etc.

Thanks @mjw.

Looking again at my debug information, I think 256M is the max and it’s reflected in the info above.

I also went and checked my php.ini file it also says 256M.

Increase the amount in 256M increments, and see that helps.

1 Like

Another option if @mjw’s suggestion doesn’t work is to use Ghost’s migrate CLI tool (if you’re comfortable on the command line).

It’s not too difficult to set up and use and will generate all needed assets to import into your Ghost site.

Ahh, that seemed to work for me at 512M. Thank-you.

1 Like

If the above failed for me I would have given this a try. Thanks @RyanF.

1 Like

I had 109k posts and the ghost export plugin was failing. I even increased the memory limit to 1G, and max_execution_time to 180 seconds. Still failed.

Tried the migrate CLI tool. After some time, this error was shown:

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

[55578:0x120008000]   279922 ms: Scavenge 2029.8 (2081.8) -> 2024.0 (2082.5) MB, 4.8 / 0.0 ms  (average mu = 0.551, current mu = 0.418) allocation failure; 
[55578:0x120008000]   279936 ms: Scavenge 2030.7 (2082.5) -> 2025.1 (2083.8) MB, 4.9 / 0.0 ms  (average mu = 0.551, current mu = 0.418) allocation failure; 
[55578:0x120008000]   281023 ms: Scavenge 2031.7 (2083.8) -> 2026.0 (2100.0) MB, 1075.7 / 0.0 ms  (average mu = 0.551, current mu = 0.418) allocation failure; 

Any suggestions please?

Try the migrate cli tool with batch and limit settings.109k posts is a crazy number!