Rename all existing files using Storage Template
Hi everyone, when I initially set up immich, I kept the {{filename}} in the template, but it didn't quite work out the way I intended.
I've since updated the storage template to "{{y}}/{{y}}-{{MM}}/{{filetype}}{{dd}}-{{MMM}}-{{yy}}{{HH}}{{mm}}{{ss}}" to get something along these lines "UPLOAD_LOCATION/library/admin/2022/2022-02/IMG_03-Feb-22_045605.jpg".
The issue I'm facing is, when I run the " STORAGE TEMPLATE MIGRATION" job, it mentions "Apply the current Storage Template to previously uploaded assets" but it only shows "1" under "Active" for a brief moment and then finishes and only applies changes to the folder structure and not individual files.
What I want is for all the files to get renamed according to the new storage template without having to remove and reupload everything.
Is there a way I could go about this? I'm running immich v1.133.0 v1.33.1 (updated as part of the checklist below) as a docker container on ubuntu server.
21 Replies
:wave: Hey @MrSolution98,
Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:.
References
- Container Logs:
docker compose logs
docs
- Container Status: docker ps -a
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
- Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA
Checklist
I have...
1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
2. :ballot_box_with_check: read applicable release notes.
3. :ballot_box_with_check: reviewed the FAQs for known issues.
4. :ballot_box_with_check: reviewed Github for known issues.
5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy).
6. :ballot_box_with_check: uploaded the relevant information (see below).
7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable
(an item can be marked as "complete" by reacting with the appropriate number)
Information
In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:
- Your docker-compose.yml and .env files.
- Logs from all the containers and their status (see above).
- All the troubleshooting steps you've tried so far.
- Any recent changes you've made to Immich or your system.
- Details about your system (both software/OS and hardware).
- Details about your storage (filesystems, type of disks, output of commands like fdisk -l
and df -h
).
- The version of the Immich server, mobile app, and other relevant pieces.
- Any other information that you think might be relevant.
Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.It should do all that. Please post everything the bot asked for… compose env logs etc
I guess you should show your template settings screenshot and what you see / what you expect
Storage Template:

What I expect is for it to rename all the existing images and videos and show that it's doing that like it does for metadata extraction:

What it actually does:

That’s totally normal.
The issue I'm facing is that, in the storage template settings, it says this:

Sure, you haven’t shown the file of issue
So far everything you’ve shown is working properly. 1 job covers all files
Implying I can retroactively apply the template to previously uploaded assets by running the storage template migration job. But it only applies to the folder structure when I do that, where as it applies to all files and their names when it happens for the first time
That's the thing, When I go into the "Folder" view, I can confirm that none of the files have had their filenames changed. after that job. They still have wildly different filenames, unlike the template I set.
When I first set up the immich container, it did have an impact on the filenames. But I did not set the template up the way I intend as I did not quite know what I wanted regarding that. I'm trying to retroactively apply the template and rename all the files. But that is not happening when I run the storage template migration job.
Oh wow... I think I have found the issue....
The "Explorer" / "Folder" view in immich shows the old file names on the thumbnails for some reason. I've navigated to the same folder and the files have actually been renamed 🤦
I've run a job to regenerate thumbnails now to see if the filenames I was seeing are related in some way to them. Writing here when it finishes the generation.
If that’s actually true that sounds like a bug
Well, is it showing the old name, or just the IMG_xxxx name
The visual issue did not get resolved by regenerating all the thumbnails so the filenames displayed in the folder view are not related to the thumbnails
Here is an example
This is the filename shown in the folder view

And here is that same file's filename when I navigate to it

So, the storage template migration job was actually doing what it was supposed to all along. It's just that I was checking the results in the wrong place and that's what caused my confusion.
That's my bad, but it definitely is a bug of sorts, just not one that would affect too many people as I doubt everyone enables the folder view anyway 🤷
Before I close this thread as the issue I was having is resolved, is there something I should to to report this bug vith the folder view? 🙂
And, also, thank you for jumping in to help!
That name doesn’t seem related to immich at all. Is it the original name of the file? The folder view might show that
Yes, it's the original filename
That might not be a bug. I would have to check on my instance
The part that confused me was that when I finally checked what the file is named now, it is named the way immich named it using the template. But, its' just that the folder view shows the original file name, and not the actual current one.
This thread has been closed. To re-open, use the button below.