A NodeJS utility to download and organize images from a Ghost blog export file.
This tool helps you migrate images from a Ghost blog by:
- Reading a Ghost export file (JSON)
- Extracting all image URLs from posts
- Creating an organized folder structure
- Downloading all images locally
- Easy copy / paste folder structure to your Ghost instance
- Node.js (v22.13 or higher)
- pnpm or yarn
- A Ghost blog export file (JSON format)
- Clone this repository:
$ git clone https://github.com/alejomejia/ghost-image-exporter
$ cd ghost-image-migration
- Install dependencies:
$ pnpm install
Or
$ yarn install
-
Create a
.env
file in the root directory:GHOST_BASE_URL="https://y.x.com"
-
Place your Ghost export file as
data.json
in the root directory
Run the migration tool:
$ pnpm start
The tool will:
- Create the necessary folder structure
- Extract image URLs from all posts
- Create individual folders for images
- Download all images to their respective folders
The tool will create the following folder structure for your images, same as Ghost file structure:
root
└── .temp
└──── content
└────── images
└──────── {year}
└────────── {month}
└──────────── {filename}
Then you can copy / paste the folder with the images into the new Ghost installation.