Wordpress to Ghost Migration Update

3327, each with multiple images

Thanks for this feedback, much appreciated.

To confirm:

  • The zip download failed
  • The JSON only download worked after increasing server resource allocation
  • The problem at the moment is importing the JSON into Ghost?

I’ve read the Ghost 3.0 announcement and also the news about the new version of the migration plugin. I’ve installed Ghost 3.0 on my VPS and it’s working fine, and I’d like to export my WordPress blog posts to the Ghost one.

I’ve installed the plugin but it doesn’t work. After a few seconds the following message appears: “The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.”

I guess this is due to my blog being quite large. I’ve got over 3,100 posts (it’s been up since 2005) and I guess the script needs more time (or memory, or file size permissions) to finish its work. Could somebody help to find the exact problem and how to solve it?

I’ve tried to change some PHP parameters in my WordPress’ VPS (I use EasyEngine there to automate some processes, but I don’t use EE on the Ghost VPS, that’s a different one). According to this support article I’ve changed this on the “custom.ini” file:

max_input_vars = 1234
max_memory_limit = 1024M
max_execution_time = 2000
upload_max_filesize =100M
post_max_size =100M

After restarting nginx and PHP the plugin still doesn’t work. Same error, even when I try to download the .json file. It always shows the error after 30s of thinking. I guess there is some 30 seconds value somewhere that has to be edited but I don’t find where, according to the EasyEngine docs it should work. In fact the ghost migrator info shows 1GB memory limit and 2000s execution time, so the problem lies somewhere else.

My WordPress folder is 2.2 GB in size, and my VPS has 11 GB of space available.

30sec is not particularly long for a large import, sometimes it can take a few minutes. What error are you getting? If the request times out, as long as the upload has finished (that part shouldn’t time out with most server setups) then it will continue to be processed in the background.

hi @javipas - thank you for the feedback. Much appreciated. :+1:

Regarding generating the zip - I was able to zip just under 3GB in around 20 to 30 min on a shared hosting so 2000 seconds should be a good base amount but if you can, try to increase it some more, maybe try 60min / 3600 seconds.

The PHP max_execution_time does however seem to be reporting correctly so maybe there’s something else on the system causing a timeout. I recommend checking the NGINX proxy_read_timeout value.

Please let us know if that makes a difference.

Thanks for the suggestion. I’m afraid it doesn’t work. I’ve looked for timeout values and there was a “keepalive_timeout 30;” line on the nginx.conf file. I changed it to 3600 and also added the proxy_read_timeout value (there was none) without luck. (I always restart nginx and php to apply the changes, of course).

In fact the message I got previously appears at random times, always lower than 30s. I’ve used the chronometer in the smartphone and it was 24, 26, 23, 21 seconds… No idea what’s happening here. I guess the EasyEngine config makes it a little bit difficult and obscure, I could try to setup a virtualmachine with a normal LEMP server (without Easy Engine), install there a backup of the WordPress blog and run the Ghost migrator plugin from there, but I’ll have to spend a little time with that and I’m not in a big hurry.

Thank you again for your suggestions, if someone has other ideas just let me know.

Try also with fastcgi timeouts.

Hi @javipas - thank you for the additional feedback. :+1:

I’ve just experienced a similar issue with a site hosted on WP Engine. The PHP memory limit and max execution time were both reporting high values but it would fail after ~60 seconds.

After some further investigation, I discovered that WP Engine kills any process running for ~60 seconds and there’s not much we can do about it so it’s definitely possible that there’s something not-PHP related that is causing the process to fail/timeout.

Then, on a test site, I used a random content generator to generate 3,576 posts. It initially failed with the original site settings (96MB memory limit) but I incrementally increased the memory limit to 256MB and then it downloaded successfully. Something I noticed during this process was that PHP was reporting a memory limit that differed from the value actually applied to/configured on the site/domain (presumably a global server value) so that’s something to keep in mind.

That makes sense, I guess there’s something on EasyEngine installation that automates that kind of behaviour. I’ve asked there if someone can think of a solution

Let’s see if that helps. Thanks for the quick replies :wink:

Sure thing. :+1: :slight_smile: I’m keen to know what the root cause of the timeout is.

I think that tweaking php and nginx configs is not the right way.

As I’ve mentioned in githubs issue, WP-CLI compatibility to export through command line will be much more effective and precise manner. The plugin author confirmed that WP-CLI support is on the go.

Hi @codemotion - Some people won’t have SSH and CLI access to their WordPress installations so we’d ideally like the GUI to work for as many people as possible.

I am however working on WP-CLI support and hope to have an initial version ready for release soon.

This worked for me https://stackoverflow.com/questions/18740635/nginx-upstream-timed-out-110-connection-timed-out-while-reading-response-hea

Hi support.

I try to export WordPress but Zip cannot working.

I export json file and Download about 14mb json file. When I import to Ghost, it not working.

My website have about 400 articles, 1.9GB Image.

Thank you!

Has the json file the correct format?

For me the export file from Wordpress hat one missing „}“ at the end.

Hi all :wave:

We’ve recently updated our WordPress to Ghost migration guide. This uses the latest version of the WordPress Export to Ghost Plugin which exports posts, pages, tags, authors and images to a zip file you can upload directly to Ghost admin:

If you see any issues then let us know, thanks!

1 Like

The wordpress plugin simply doesn’t work for any decent sized Wordpress site (we have 4,000 posts). It just throws an error. Downloading the JSON file, and trying to upload it causes an error on the ghost side of things. Need to have better tools to move over a wordpress site to ghost. Anybody have any luck converting the XML export from wordpress to Ghost format for import?

Hey @osseodds, have you tried exporting just the json file rather than everything? Images can be downloaded from your WordPress server instead

Hey, what we ended up doing was fixing the wordpress plugin, by just adding a $posts_args array value in the plugin to control the number of posts that are exported at one time (line 302 in the plugin). For example, we added an argument ‘posts_per_page’ => 50. This worked b/c now we only export 50 posts at a time.

However, we can’t actually import anything on the Ghost application. We keep getting the following error on the ghost side:
“Failed to load resource: ghost/api/v3/admin/db/:1 the server responded with a status of 504 ()”

FYI, we are importing everything via the admin. The error above is what is shown in the console. The actual error in the admin is just that the import has failed and check the console for errors. We only have 5 posts in the import file.

Do you have a memory limit on your WordPress site? Could be why you’re having to reduce the amount of posts being exported.

It might be worth running your json file from the export through a JSON validator just in case there’s some malformed data in it. It shouldn’t be the case but it’s good to eliminate this possibility before trying other solutions :+1:

1 Like