# Migrating from Wordpress not working

**URL:** <https://forum.ghost.org/t/migrating-from-wordpress-not-working/44422>\
**Category:** Migrations\
**Created:** [January 24, 2024, 4:44pm UTC](https://forum.ghost.org/t/migrating-from-wordpress-not-working/44422 "2024-01-24T16:44:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![JMwriter](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@JMwriter](https://forum.ghost.org/u/JMwriter)\
**Post date:** [January 24, 2024, 4:44pm UTC](https://forum.ghost.org/t/migrating-from-wordpress-not-working/44422/1 "2024-01-24T16:44:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [January 24, 2024, 5:28pm UTC](https://forum.ghost.org/t/migrating-from-wordpress-not-working/44422/2 "2024-01-24T17:28:06Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![fatshark](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/fatshark/32/28558_2.png) [@fatshark](https://forum.ghost.org/u/fatshark)\
**Post date:** [January 24, 2024, 9:09pm UTC](https://forum.ghost.org/t/migrating-from-wordpress-not-working/44422/3 "2024-01-24T21:09:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JMwriter](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@JMwriter](https://forum.ghost.org/u/JMwriter)\
**Post date:** [January 25, 2024, 6:04am UTC](https://forum.ghost.org/t/migrating-from-wordpress-not-working/44422/4 "2024-01-25T06:04:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![fatshark](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/fatshark/32/28558_2.png) [@fatshark](https://forum.ghost.org/u/fatshark)\
**Post date:** [January 25, 2024, 11:40am UTC](https://forum.ghost.org/t/migrating-from-wordpress-not-working/44422/5 "2024-01-25T11:40:16Z")

</div>

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
- Create `./content/images/` directories and move `/uploads` into `/images`.
- Rename `/uploads` to `/wordpress` so creating: `./content/images/wordpress/nnnn/etc/`

If your in the parent directory containing `/content` you can zip it up, move it elsewhere, unpack it and it should create a `./content/images/wordpress/nnnn`

---

<div class="post-metadata">

**Author:** ![JMwriter](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@JMwriter](https://forum.ghost.org/u/JMwriter)\
**Post date:** [January 25, 2024, 4:28pm UTC](https://forum.ghost.org/t/migrating-from-wordpress-not-working/44422/6 "2024-01-25T16:28:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![fatshark](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/fatshark/32/28558_2.png) [@fatshark](https://forum.ghost.org/u/fatshark)\
**Post date:** [January 25, 2024, 5:26pm UTC](https://forum.ghost.org/t/migrating-from-wordpress-not-working/44422/7 "2024-01-25T17:26:11Z")

</div>

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:

```auto
<a href=\\\"\/content\/images\/wordpress\/2014\/09\/20140525-0005.jpg\\\">

```

Download the `/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 `/content`.

 ![Screenshot 2024-01-25 at 17.18.30](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/9/0/90f8991e859122bd57dceb58fa8a64dd72b496f6.png)

Drag and drop the `/wordpress` directory into the `/images` directory. Then drag and drop images into `/content`.

Select `/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.

---

<div class="post-metadata">

**Author:** ![JMwriter](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@JMwriter](https://forum.ghost.org/u/JMwriter)\
**Post date:** [January 25, 2024, 6:58pm UTC](https://forum.ghost.org/t/migrating-from-wordpress-not-working/44422/8 "2024-01-25T18:58:59Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![stellarpower](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/stellarpower/32/32068_2.png) [@stellarpower](https://forum.ghost.org/u/stellarpower)\
**Post date:** [September 9, 2024, 5:03pm UTC](https://forum.ghost.org/t/migrating-from-wordpress-not-working/44422/9 "2024-09-09T17:03:30Z")

</div>

Just some advice in case anyone else has troubles - the zip file I got form wordpress contained a plaintext error message at the head of the file - which makes me sad. Having removed that the archive file was readable - but ghost was still unable to process it.

If anyone else is having problems, you can try unzipping the archive from WordPress and rezipping it on your local machine. That did the trick for me, whatever weirdness was in the original.
