Site still looks for images in old location after moving Media library

J M asked on December 21, 2020 20:52

For the sake of argument, let's say my K12 Portal Engine site is in D:\WebRoot\SiteName. We're working on automated Azure Release Pipelines, but what we want to eventually be able to do is to obliterate the SiteName folder each rollout, but without having many, many GB of images, audio, video, etc., in our repo. Blob storage is not an option, local IIS file system storage is the only thing permissible, and if this cannot be done under that limitation, then it simply cannot be done for the intents and purposes of this post.

Based on this and related postings, I copied everything to D:\WebRoot\SiteNameMedia and updated the relevant setting. However, Kentico keeps creating additional empty folders in that location, including a CMSPages folder, and no matter how many times I blow away the cache, Kentico keeps trying to serve the URLs from the old location, which naturally 404s. Basically, whether I leave those settings at default or not, Kentico won't load images now that I've moved them out of Kentico's default location. No change in settings, restarting of the app, clearing of server cache, etc., stops Kentico from serving from sitename.com/KenticoSiteNmaeInSettings/media/mediaLibraryNameThatSettingsMakeVeryClearWeAreNotUsing/imagename.png Nothing I've found online and followed has even allowed the main logo of the site to load. I know the files exist, I can see them in Explorer, and this all worked just fine before I touched the media location. Media Libraries were NOT being used on this particular site, (it's our smallest Kentico app, hence why it was chosen as the gueanea pig for this,) but I'm getting less and less certain whether I need a Q&A or an exorcist for this thing.

Again, any other than the exact folder structure I listed above is not a valid solution within our limitations. If a license issue is at play, (server farm stuff, whatever,) that's also a deal breaker for this issue. The company is very, very, VERY tightly regulated externally, and internally we regulate ourselves more tightly still, so "You just need to xyz" answers may not be possible. If the answer is, "You can't do that without a server farm license," then that's what I'll have to go back and say to The Powers That Be.

Thanks for taking time out of your Christmas week to read!

Recent Answers


Brenden Kehren answered on December 21, 2020 21:18

Does each of your sites use the same (shared) Xperience instance and database or are each of the sites on their own Xperience instance and database?

If each site is their own instance and database then make sure the individual site settings for the media library path is NOT overridden at the site level. Check the settings and make sure you change the site selector in the upper left of the page.

Next, make sure your path is a physical path on the server or a UNC path AND the user/app identity running the app pool for that site has read/write access. On the folder, you'd need to give read/write access to the IIS_IUSRS user account. If Xperience is unable to gain read/write access to that folder, it may just default to the directory it does have access to.

Lastly, make sure you have things spelled correctly.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.