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

Export not working with latest Wordpress 4.4.1 Version. Creates File, but is Corrupt. #20

Closed theShiva closed 8 years ago

theShiva commented 8 years ago

Hi,

Here's what I did.

1) Downloaded the repository as a .zip file. 2) Uploaded it as a .zip file in my WPEngine.com hosted Wordpress blog - WP Version 4.4.1. 3) Successfully installed and activated the plugin. 4) Clicked Export to Hugo from the Tools menu. 5) The export started and it created a 54 mb .zip file in my local windows download folder. 6) I tried to unzip the .zip file and am getting an error that the file is corrupt. 7) I tried double-clicking .zip file and when I did that, there's nothing inside.

So the file is getting created, because I can open it in a text editor and see binary characters, and it is about 54 Mb, i.e. not an empty file.

I don't know the PHP and other versions. I think Wpengine.com uses the latest of everything.

hiproz commented 8 years ago
  1. you can try the cli command method. then check the zip in the /tmp dir .unzip it in the server for the test
  2. u can change an nother zip clients for the test .or let others check for u. if have new infos, let's know it
theShiva commented 8 years ago

Hi @hiproz

Thanks for your reply. Windows guy here, and I didn't want to spend time trying out WP-CLI on wpengine.com, so here's what I did.

  1. Exported the wordpress database and downloaded the files from the filesystem to my PC.
  2. Setup a local install of my wordpress site using WAMP.
  3. Installed this plugin on the local instance of the wordpress site.
  4. Commented out the code that zips the file, and ran the export.

I then went to the temp directory and found all the posts properly exported as .md markdown files.

Now that I isolated the issue to the part that zips the files, I manually tried to zip the folder that was created by this plugin, and got the following error. (see screenshot).

image

Here's the file name (that error-ed out in the zip attempt) on the filesystem in the temp folder that the plugin dropped the .md files in.

``

And this is the actual URL on the live site, for the post.

image

What is strange, is that the url in the browse is not showing any special / wierd characters, but when I copy/paste it into this github post, it turns into the following

http://oobly.com/2011/02/01/startup-grind-february-2011-%E2%80%93-featuring-serial-entrepreneur-jason-calcanis-mahalo-weblogs-inc_98/

Notice the 3 dashes --- after 2011 have turned into some encoded characters.

Any ideas what is going on?

Here's the actual page, if you want to look at the source on live site, or the URL.

image

SchumacherFM commented 8 years ago

There are no three consecutive dashes in the URL between "2011" and "featuring". There is: dash; EM dash; dash. This EM dash (https://en.wikipedia.org/wiki/Dash) is causing the weird file name which does not work in windows.

Simply delete in your wordpress database those three dash and replace them with three normal dashes. rerun the export and you're fine ...

theShiva commented 8 years ago

Thanks @SchumacherFM

I deleted the 3 dashes, and even deleted that post and tried the export.

It's still creating a zip file that has bytes, but doesn't unzip, on windows.

So for now, I just using the unzipped set of files that the exporter created on the C:\Windows\temp folder.

--Shva