Support » Networking WordPress » Removing ms-files.php after Upgrading Existing Multisite to 3.5

  • Resolved colinmcgray

    (@colinmcgray)


    Hi folks,

    I’m currently upgrading a long running multi-site to 3.5 and I’m hoping to take advantage of the removal of ms-files.php.

    I’d love to get rid of the extra server load, as well as a bunch of problems handling streaming audio files.

    I realise that upgrading to 3.5 as standard just keeps on ms-files, but I’d love to get rid of it. I can’t seem to find decent guidance on how to make this happen though.

    I’d really appreciate any help anyone can offer on this – simply how to disable ms-files.php after upgrading an existing multisite to WP3.5.

    Thanks!
    Colin

Viewing 12 replies - 1 through 12 (of 12 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I have been toying around with this.

    In THEORY.

    1) Move images from blogs.dir/SITENUM/files/ to /uploads/SITENUM/ (or make an alias)

    2) Edit all sites so they don’t look in /files/ but in /uploads/SITENUM/

    3) .htaccess, remove the ms-files.php line

    4) Search/replace each posts table for each site, changing /files/ to /uploads/SITENUM/

    I think that’s it, but I haven’t gotten around to actually doing it yet.

    Thread Starter colinmcgray

    (@colinmcgray)

    Thanks very much for getting back to me!

    So, it’s a pretty manual process… That’s going to take a fair while to do with a large Multisite… If it’s the only way though

    In step 2, I’m not sure I understand how you would do this – where would you make the edit?

    Thanks!
    Colin

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Step 2 takes place in wp-admin/networks/sites.php – Edit site :/

    Thread Starter colinmcgray

    (@colinmcgray)

    Thanks for the help on this Mika!

    I’m still trying to figure it out, but your blog post on the subject helped a bit too. I see you think there are still ways to improve on how you did it though. Do you happen to have done any more work on it since? I’d be really interested to know whether you’ve streamlined the process since…

    Also, do you think it might be better to start from scratch? I think this might be a good time to streamline my site, getting rid of the chaff. I reckon I could get it down to around 50 active sites. At this level, I think it’s almost worth starting again, installing 3.5 as a blank canvas and then just importing the old blogs. I’m not entirely sure how tricky that might be though…. what do you think?

    Colin

    But then you’d have to restore widgets, theme options and so on… I’m going through this in one of my networks, luckily there are only a few blogs at this moment. I’d go definitely for editing the sites at hand. But I’m going to trying to do, not something I know the outcome.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I haven’t gotten it better yet. I sort of stopped since it ‘works for me’ and I got busy 😉

    Probably a little late to be of any help, but I started on a plugin at the end of last year and finally got around to posting a download link on my site.

    Thread Starter colinmcgray

    (@colinmcgray)

    Hi Richard, thanks for that update. I actually opted to start from scratch, installing a brand new Multisite, and migrating the blogs manually. A bit of work, I know, but the site benefitted from the clear-out.

    Quick question to you or Mika though:

    I had thought that the point of dropping ms-files was that files were then delivered with no redirects, just a link direct to the file.

    But… when I upload files to the media library now, it includes the actual path, but still puts on the site name at the start. eg:

    The file is physically at –
    http://www.themultisite.com/wp-content/uploads/site/15/2013/1/1/podcast.mp3

    But in the media library it’s listed as –
    http://www.themultisite.com/subsite/wp-content/uploads/site/15/2013/1/1/podcast.mp3

    Is this then still redirecting to reach the file? The 1st link above does work, but I want to use it all the time, rathern than the second, because iTunes and other Podcasting platforms have trouble streaming from the redirected link.

    If either of you can shed any light on this I’d much appreciate it!

    Thanks,
    Colin

    I noticed the same problem and seem to recall doing something like changing the upload_url_path option in the site settings to ‘wp-content/uploads/’.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    WordPress will always be able to use both URLs in your example. By preference it will use the /subsite/ URL since it wants to use everything relatively.

    You can edit the upload_url_path in WP Admin -> Networks -> Sites -> Edit Site 15 🙂

    Is there a native way to remove the /sites/XX from the image’s url?
    i.e. file is physically in :
    http://domain.com/subsite/wp-content/uploads/sites/4/2013/08/file.jpg
    and I want that this will work too:
    http://domain.com/subsite/wp-content/uploads/2013/08/file.jpg

    Thanks

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    maorb, you;re going backwards from this post.

    Believe it or not, this post was to STOP doing something like that. And yes, there is. Reverse engineerin ms-files.php and sort out how it does it.

    You can (and should) make your own topic about this, though.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Removing ms-files.php after Upgrading Existing Multisite to 3.5’ is closed to new replies.