How can I upload image/videos backdated?

I want to migrate my old blog to Ghost. Unfortunately, my previous blog service isn’t compatible with Ghost, so I have to upload my contents one by one.

I know that I can publish my post backdated, making it look like to be posted in 2019.

But if I look into Ghost’s content directory, all of my uploaded images and videos are in 2023 directory, rather than in 2019 directory.
If I let Ghost to upload contents for post written at 2019 to 2023 directory and continue to migrate my old blog posts, the 2023 directory will have thousands of images and videos, including resized images.

I don’t want it.
I want Ghost to upload images and videos to given year/month directory, rather than current year/month directory.

Or, I want to put images and videos already uploaded to content directory. Currently, I always have to upload new images even though I can re-use same images already uploaded.


TL;DR

I want to know either one of these:

  1. How to make Ghost put uploaded images and videos to certain year/month directory?
  2. How to use images or vidoes that are already uploaded manually in editor?

Are you self-hosting or using Ghost(Pro)?

I’m self-hosting Ghost.

After you get all your content uploaded, you could try using gctools find-replace feature to rename a bunch of those 2023 URLs back to another a year:

At the same time, you could log into the server and physically move them to the alternate folder you’d like to back-date them too.

Time Travel Alternative

Alternately, you could try this hack: Log into your server and set the server’s time back to a point in 2019 and then upload some posts. Ha. Assuming Ghost is using the server system clock, it would back-date them. You may need to restart Ghost after changing the system time.

Continue to time travel by setting the server system clock as needed.

Untested idea!

1 Like

Thanks, I will try using gctools. I didn’t know that this kind of tool existed…

If gctools don’t work, I will change server’s system time back to 2019 and see if Ghost recognizes ‘current time’ as 2019.

PS. I though that I can mark your answer as ‘Answer’ but I can’t. But If I can, I will mark your answer as ‘Accepted Answer’. Thank you a lot!

1 Like

Sorry to ask again, but I can’t use gctools.

GitHub README says

  1. Run yarn to install
  2. Run yarn link to make it global
  3. (Yarn said) CD to Ghost installation directory and run yarn link gctools

But after that, gctools is still not recognized as valid program name.

I tried npm install https://github.com/TryGhost/gctools -g to force install gctools globally. But when I try to run it, it gives me error like

node:fs:1396
  handleErrorFromBinding(ctx);
  ^

Error: EINVAL: invalid argument, mkdir '\C:\Users\[MyUserName]\AppData\Roaming\npm\node_modules\gctools\logs'
    at mkdirSync (node:fs:1396:3)
    at file:///C:/Users/[MyUserName]/AppData/Roaming/npm/node_modules/gctools/lib/loggingrc.js:9:5
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
  errno: -4071,
  syscall: 'mkdir',
  code: 'EINVAL',
  path: '\\C:\\Users\\[MyUserName]\\AppData\\Roaming\\npm\\node_modules\\gctools\\logs'
}

Node.js v18.16.0

I really don’t know how to handle this error.

I’ve manually exported contents as JSON and open it with Notepad++ and re-imported it as an workaround. It replaced all ‘current time’ to ‘old time’, but I prefer using ‘official’ tool instead.

I’m having a similar problem. The GitHub instructions are super confusing. I download the repo, run “yarn” it downloads a bunch of stuff, then I run “yarn link” it then suggests to run “yarn link gctools” in my project directory (which I do in the /var/www/ghost directory. But when I run “gctools” or “gctools I” nothing runs, it just says:

Command 'gctools' not found, did you mean: command 'gcstools' from deb opengcs (0.3.4+dfsg2-0ubuntu8) command 'gftools' from deb gftools (0.5.2+dfsg-2) Try: sudo apt install <deb name>

You can also run gctools like this:

 node /path/to/to/gctools/bin/cli.js
1 Like