WordPress.org

Forums

[resolved] Image location hell (6 posts)

  1. OceanWind
    Member
    Posted 1 year ago #

    Hi all,

    I've got a WordPress multisite installation that has been running since pre-WP 3.0 times. In the most recent upgrade, the images have gone totally wonky on the subsites. The media libraries have disappeared on the backend, and within subsites, featured images are not being found.

    Looking in the database I see 3 distinct types of storage conventions stored in guid for images and other uploads:
    - http://mydomain.com/wp-content/uploads/2013/04/image.png
    - http://mydomain.com/subsite/files/2013/06/image.jpeg
    - http://mydomain.com/subsite/wp-content/blogs.dir/3/files/2013/12/image.jpg

    I desperately need to sort this out and want to move all files to the most current format. Questions:

    1) Which file format is the most current?

    2) Is there any reason I can't do a search/replace on the DB to align these all with the same directory structure, and then move all the images to the new location?

    3) Is the slightly modified .htaccess file code the only difference between multisite stored after WP v3.5 and earlier versions?

    I'm willing and able to do deep work to make this function again. Any help is appreciated.

    Thanks.

  2. Take a deep breath, tis confusing.

    Back in WP Multisite 3.0 (i.e. when it first became part of WP core), it worked by using /files/ in the URL for all sites on the network. The files folder was a FAKE folder, tweaked into existence by the .htaccess file. Your images were ACTUALLY in wp-content/blogs.dir/# etc....

    As of WP 3.5, the /files/ trick was removed for all NEW networks. if you had one, it kept using /files/, but all newly minted multisites put their files in /wp-content/uploads/sites/#/

    So.

    1) The location of the files for a pre-3.0 WPMU install, upgraded to 3.8, would be /wp-content/blogs.dir... however the URL that shows in the browser would be /files/

    2) Yeeeeees, but you have to do it per site and you would search wp_3_posts and change /files/ to /wp-content/uploads/sites/3/ and so on.

    3) When you say disappeared, do you mean the media library is EMPTY, or that the images don't show? If they aren't showing, what's in your .htaccess?

    (FWIW, you can switch a site to us /uploads/ which I find generally easier ... http://halfelf.org/2012/dumping-ms-files/ )

  3. OceanWind
    Member
    Posted 1 year ago #

    Thanks, Ipstenu! This is the first explanation I've found that got to the heart of the issue.

    So, do you see any problems with this approach:

    1) Transfer all files from blogs.dir/2/ to uploads/sites/2/
    2) Replace the guid's with /[subsite name]/blogs.dir to /uploads

    QUESTION: Is there any reason to keep /[subsite name]/ in the guid since it's redundant with having the subsite id in the path?

    For some reason (perhaps my not fully informed mind when I created this site), I have 'files' in the physical directory structure:

    http://mysite.com/wp-content/blogs.dir/2/files/2014/01

    I can get rid of that, right?

    And yes, no image files are displaying in the media gallery. I'm hoping they reappear when I build up from a fresh multisite install, and getting all the guid's and the physical locations in line with 3.8 standards.

    Thanks so much for your help.

  4. You can't just transfer the files over, though. That's why http://halfelf.org/2012/dumping-ms-files/ is as long as it is :/

    For some reason (perhaps my not fully informed mind when I created this site), I have 'files' in the physical directory structure:

    http://mysite.com/wp-content/blogs.dir/2/files/2014/01

    That's actually where your files are. the domain.com/files/ URL redirects to that, so if you deleted those files, you'd have no images.

  5. alvarezcyberx
    Member
    Posted 1 year ago #

    ok so I think lots of others are having this same issue. My multi site was working just FINE until, it auto updated to 3.8 and now all subsites have non working images.

    OceanWind, did you ever figure out how to fix this?

    Ipstenu, there has to be something we can change to easily fix this right? I mean, it updates wordpress and now images don't show, so what do we do to fix it?

  6. alvarezcyberx
    Member
    Posted 1 year ago #

    Ok I think I fixed it, somehow the code in the .htaccess file had changed, and no longer had the code for the files redirect. Added the correct code and it now seems to be working.

Topic Closed

This topic has been closed to new replies.

About this Topic