So, I’m trying to migrate a personal site from WordPress to Ghost. I go through the steps outlined in the migration docs: categories to tags, use the plug-in, and press the “download to ghost file.” When I upload the zip file to Ghost(Pro) I get an odd error:
, cannot fetch db
I know that I can upload the JSON, but I’ve got no programming experience and wouldn’t even know where to begin in trying to parse out the images and connect them to the correct directories. This isn’t a big site (ghost starter, so no concierge), but I’m a poor author and tight on time. Any suggestions?
It’s probably worth opening up that zip file (which your computer can do - right click and ‘extract’ it) and see if it seems to contain your content. If it doesn’t, then the problem is in the WP export, not the Ghost import. Might narrow things down a bit…
Doing the images separately is trivial if you can download them from your WP site. The plugin makes the necessary changes to the JSON file so you don’t need to change anything. Just zip the images up in /content/images/wordpress/NNNN and upload them as you did the JSON file.
Note that ‘wordpress’ is automagically included in the JSON changes by the plugin, so you do need to make sure the directory structure and names are correct.
On wordpress the images are in year-dated directories under /wp-content/uploads/YYYY … on Ghost the corresponding structure is /content/images/wordpress/YYYY
I’ve done this recently with ~20,000 images and the separate JSON file and it worked well.
Thanks, Cathy and Fatshark, for the responses. I downloaded the JSON file, uploaded it. I got my basic text and posts, which is good.
I downloaded my images, zipped them with the corresponding structure (images/wordpress/YYYY/), and still got an error: “Request contains an unknown or unsupported file type.” (I also tried without the /).
I took out a pdf I found in there, still no dice. Does Ghost not accept certain image file types, like a .png, or a .gif, or something? Is there a special way I’m supposed to zip these files? I’m a bit frustrated (due to my ignorance), and I really don’t have any time to figure this out.
Hi @JMwriter … I think I had the same error but can’t remember exactly what the issue was. Ghost certainly works with .png .webp .jpg .jpeg types.
Are you sure you have the directory structure correct?
The zipped file should unpack and generate /content/images/wordpress/YYYY if you omit the content it won’t work.
My scrawled notes state:
- Remove PDF’s
./content/images/ directories and move
/wordpress so creating:
If your in the parent directory containing
/content you can zip it up, move it elsewhere, unpack it and it should create a
So, I edited the JSON file with the “find and replace” to make it “/content/images/wordpress/.”
I tried renaming the folders (I’m using a Mac): “content” → “images” → “wordpress,” and the rest is divided by year and so on, and zipping that together. No dice. I tried the same but adding an “/” after each, and I either get , cannot fetch db, or Request contains an unknown or unsupported file type.
I tried uploading it together with the JSON file, and independently. When I’ve uploaded together, it says that it’s working but the images don’t upload. I’ve tried with an unmodified JSON as well.
I’ve even tried to up the PHP timeout from 60 to 120 to see if the Ghosty Plug-in’s Zip would work better, and it didn’t. (Also, you were right, the zip export from the Ghost plugin won’t open on my mac.)
All the images seem fine: there are no .pdfs. I’m really out of my depth here and about to give up until I can afford to pay for migration help.
Apologies … perhaps I wasn’t clear.
It sounds like your Ghost export is corrupted. I think yo said that the JSON export was OK and could be imported?
The Ghost export plugin should automatically handle the JSON changes needed. You should not need to make additional changes. I did one earlier today and this is an image link from the unmodified Ghost JSON export file:
/uploads directory from Wordpress. Rename the directory to
/wordpress. This should have all the year-dated subdirectories.
Create another directory called
/images in the same directory as
/wordpress … and then a third called
Drag and drop the
/wordpress directory into the
/images directory. Then drag and drop images into
/content, right click and select compress … you’ll end up with a
content.zip file for uploading to Ghost.
Two final points.
- I remove any directory in the original
/uploads that is not a four digit year date. Some plugins seen to dump additional stuff into this directory (which is one of the reasons I dislike WP)
- If your zip file is large there may be upload/timeout issues. Mine is over 1 Gb and I split it into a series of zip files for separate uploading. Each has the same structure, just including a few of the year-dated subdirectories.
I’ve used this approach to move a million words, 600 posts and 1 Gb of images (together with a lot of semi-automated re-tagging of the 12 Mb JSON file) and it has worked well.
YAY! I followed your directions, and it didn’t work. However, I decided to comb through the files one last time and found that some plugin (from a long time ago, I’m sure) put some files I didn’t see before (a .json, an XML in another place, etc.) I dumped those, re-zipped, and prayed, and it worked! Thank you so much, fatshark!