Removing ms-files.php Dependency

WordPress networks that were in place prior to the 3.5 update are dependent on wp-includes/ms-files.php and have that fun blogs.dir directory.

Upgrading your network to no longer have that dependency requires moving some files and making a whole bunch of database updates (mostly to reflect the changes from moving those files…)

This was my guide: http://halfelf.org/2012/dumping-ms-files/ And to reiterate what is said there, this is not something you have to do.

This post assumes certain technical ability and WordPress familiarity. Read everything, including the Half-Elf post, before proceeding to make sure you’re not going to get stuck partway through.

First, move (or copy, and delete later when you’re sure) your images from blogs.dir/BLOG_ID/files/ to /uploads/sites/BLOG_ID/.
Something like this

mkdir /path/to/wp-content/sites
cd /path/to/wp-content/sites

Then for each site

cp -r /path/to/wp-content/blogs.dir/BLOG_ID/files .
mv files BLOG_ID

For my 15-site network, doing this manually was fine. There is no doubt a script that can save you from doing this manually, but believe me when I say you don’t want me writing that for you.

Then you want to start making the database changes. Obvious are the image URLs, primarily in post_content, but also in other places, like theme_mods (custom headers, background images)

Then there are a couple other changes needed so that WordPress knows how to build the URLs, as well as where to put new uploads. So in each site’s options table, you can empty out upload_path, upload_url_path, and fileupload_url

And lastly, trip the ms_files_rewriting flag so that WordPress knows to stop treating your network like it still uses ms-files.php. ms_files_rewriting is a site option, so there’s only one place to set it (or insert it, since it may not be in the database already), and it should be false.

Once you’ve confirmed that nothing has exploded, you can remove the ms-files.php rules from your htaccess or nginx config files

To help out with the database edits, I wrote a plugin. It helped me get this network away from ms-files.php, but I haven’t done a fresh run on any other pre-3.5 network. READ THE SOURCE, USE WITH CAUTION, DON’T DO IT IN PRODUCTION LIKE ME.

Got it? I mean really. If you blow up your site, don’t come crying to me. Check it out on Github.

Send a weird postcard from Russia (by proxy)!

My mother will be traveling in Russia this summer. Part of her adventures will be a road trip! You know what that means? Small no-one’s-heard-of-them towns.

If you want to weird-out a friend, my mom will send a postcard for you.

Use my donate form to buy a postcard. In the ‘Any particular reason?’ field, provide your email address, the recipient’s name and address, as well as 2-3 little details to be mentioned in the postcard. Do they have a dog named Spot? My mom will ask how Spot is doing in the postcard. Only requirement: must be family friendly!

(She’ll also be in Scotland briefly, if you definitely do/don’t want a Scottish postcard, let me know.)

In order to cover materials, postage, time, and labor, this will cost $10 per card. Start thinking now, and get your request in over the next few weeks! She leaves on June 25th, but she’ll be able to receive new request via email (don’t worry, I’ll be sending her the info).

There is no set limit right now, as I’m not expecting heaps of interest, but I reserve the right to stop accepting requests if demand becomes too much. So don’t delay!

Where’s my mom going? See the map below. She’ll be in the 4 locations marked below, and traveling between them either by train or car.


View Larger Map

alfred-open

Why I Love Alfred.app

Despite appearances, this post is not an in-depth review of Alfred.app features. Yes, it covers many, but not all as there are some features I haven’t used to the full yet. Here, I’m covering the assorted features that I use on a regular basis. With how hard Alfred works for me, I really don’t know how I’d ever get by without it.

As of this post (and since Sep 13, 2010) I’ve launched Alfred 17,402 times for an average of 33.0 times per day. But combined with my office computer, it’s closer to 60K launches.

Continue reading

Using WordPress and P2 to Manage ALL THE THINGS!!

For the presentation I’m developing (which I may or may not actually give in public), I’m leaning toward discussing what I’ve learned about using WordPress and the P2 theme to coordinate interoffice communication.

“Using WordPress to Manage Clients, Projects, News, KB ALL THE THINGS!!”

  • Why?
    Needed a system to reduce clogged inboxes, avoid long hard-to-follow email threads, keep the conversations open so info can be found again, even by those not originally involved in the conversation.
  • The Setup
    Private team/dept blogs for discussion that would be irrelevant elsewhere. Multiple topical “public” (still private to the company) blogs (e.g. Company News, Ideas, Wiki, etc.). And CRM style functionality: managing clients and projects, which can be linked together.
  • The Plugins
    Some from P2 functions.php, and cover the custom plugins (@mention notifications, Facebook-esque “liking”, post subscriptions, cross-site post linking, etc.
  • “The Future”
    squash bugs, streamline the code, and maybe/hopefully release it

Of course, I still need to flesh things out, but I also need your help. I’d like to let the audience ask questions, but I don’t want to be caught completely off guard. Can you help me anticipate what questions might come up? From the obvious to the obscure, let me know what you might ask so I can better prepare.

WordPress Talk Ideas

Supposing I were to take the time to write up a talk on some WordPress subject (probably development related), and then supposing I were to actually give this talk in front of a group of people, what do you think it should be about?

I’m considering being prepared with a talk proposal for an upcoming WordCamp – but I need help with brainstorming. Please, please, please offer a recommendation in the comments, or hit me up on Twitter.

I can’t promise that I’ll actually end up giving a presentation – whether out of failure to submit a proposal or out of failure to bribe someone to accept mine – but I will choose a topic and make every effort to prepare a talk/tutorial/presentation and share it here on trepmal.com.