WordPress Multisite Migrations and the Meaning of Web Life

This post is heavily influenced by the goings-on at Reclaim Edtech this October, namely a month-long dive into all things WordPress Multisite for admins with Tom Woodward. It’s similar to the Domain of One’s Own workshop we have run for years, and it feels good to finally offer something for our myriad WordPress Multisite folks. Also worth noting October 24th kicks off Hacks for Hybrid Working with Maren Deepwell and Lauren Hanks—a free, month-long event that is open to anyone, you should really attend!

Image of Tom Woodward during Week 1 of WPMS 101

Tom Woodward during Week 1 of WPMS 101

But back to WordPress Multisite, I believe it’s the first event that Amanda Schmidt has run since joining Reclaim Hosting in late June, and I’m really loving the vibe. She has a wicked GIF game, as you might be able to glean from the screenshot above, and she has made impressive headway on our WordPress Multisite documentation which is a natural adjunct to this workshop. Hell, it’s even inspired me to take on a “Single Sign-on (SSO) for WordPress Multisite” article, which is a much needed push to centralize some resources and track down all the different SSO methods we currently support, including the UMW Blogs outliers. But I should return to the vibe of the edtech sessions already mentioned before I get lost in WordPress Multisite migration land. It’s fun to see Amanda, Taylor Jadin, and Pilot Irwin co-hosting with Tom. It has resulted in some great conversation and a sense of generations of edtech in dialogue with each other in an organic and generative way—and that was all Amanda’s doing. I’m really digging that, not to mention I never tire of the way our pre-recorded videos work in concert with Discord’s live chat—the delivery and episodic calendar along the top are quite elegant.

But all of that is just a way to get to this (you can see how these posts can get unnecessarily long, right?), I have been working on a migration that pulls a single site out of a WordPress Multisite, which can be a tricky process. That said, it was cool to see Tim’s document on “Migrating a WPMS Subsite to a Standalone WordPress Install” holding up brilliantly, so I won’t re-hash the process. Rather, I’ll note some things that were particular for me that might be worth remembering.

To start, the site is a mapped domain on the mighty Rampages.us, namely digitalhistology.org, and the export I got was probably using a plugin like Updraft Plus, which did not have images even though there were 5+ GB worth. So, if you are trying to pull a sub-site out of a multisite be sure to check media is in the uploads directory if you get an export. I also realized that only some of the plugins were included in the zipped export, and I imagine this is due to the ways WPMS deals with network active, must-use and forced plugins. The same can be said for themes when the theme might be a child-theme (this one was based off WP Bootstrap), which means it will depend on another theme being installed and accessible for it to run properly. It can be tricky, but making sure you know what plugins are actually used is important, and doing a visual check of a site through the dashboard helps avoid many of the pitfalls an export plugin like Updraft Plus promises for WPMS, but remains uneven at best in my experience.

So doing the preliminary work around installed themes, plugins, and making sure media is present is essential, after that you have to manage the user scenario given the user data will not come in with an export of the site tables which are managed centrally, rather than  site-by-site. This can mean downloading thousands of users to just get to one, not an ideal scenario. For this migration I realized the author info is in many ways secondary given this site is driven by page-based resources not necessarily associated with a specific author.  So I just matched the username and email with the the username and email of the new site admin, and updated the wp_user and wp_usermeta tables to make sure they match, I also had to ensure the wp_users_capibility entry was present in wp_usermeta—I have a history with losing admin access with this table when migrating out of WPMS.

At this point user has access, plugins, themes, and uploads are there, now I just drop all tables in the new site database except for wp_users and wp_usermeta and import existing tables from the export SQL file you got from the WPMS. Before importing be sure to do a find and replace of all instances of the multisite ID written into tables, for example wp_1234_options versus wp_options.To do this in your text editor of choice just find and replace all with the find being wp_1234 and replace being wp). The 1234 here would be the site ID, and with a stand-alone WordPress instance that ID is no longer needed and can often break things.

After you import everything successfully, it’s time to look it over, which took some time for me cause I was working through a resource Tom Woodward built for a faculty member over many years and reproducing the process was pretty wild. I actually had a ton of fun trying to figure a few pieces out, but all-in-all it was pretty seamless. I gauge my success—and Tom’s—on not having to reach out to him during the migration. The site has over 1500 pages,  each of which uses specific data from Advanced Custom Fields to drive the experience. The site is organized around targeted topics, such as this tiny “module” on Cell Polarity:

Cell Polarity Mini-Module

It was fun seeing all the content written into custom fields, and I started to understand how this site was built using custom fields that created basic page navigation as if a slide deck. Here is a look at some of the innards:

My knowledge of Advanced Custom Fields is limited at best, so I was glad it all just worked. The only snag I ran into was the need for quotes around a url constant in a theme PHP template:

Snag on the Migration path

I went to the template in question, page-test-big.php, and added single quotes around the url constant and it worked, which is next level for this proud citizen of non-programmistan:

Wrap that url constant in single quotes, Cowboy!

There is always something rewarding about a good migration, Tim would often describe them as therapeutic. I agree, and for me it is that much sweeter when we are migrating and preserving work from these truly remarkable WordPress Multisite systems that made publishing at scale trivial, but also enabled edtechs like Tom to grow as developers. There is so much history in these files and directories, so much magic in collaborating with faculty, students, and staff to realize a vision, and it’s why the archivist in me relishes the ability to keep the dream alive. I’m lucky in that we also host Rampages, so I have privileged access to some of these things to make this transition easier. There are some complexities involved that other hosting companies may balk at, but that for me is the gold of Reclaim Hosting. We’re not other hosting companies, we are hosting for educators! This is our bread and butter, this is where we come from and this is what we believe in.

The work happening in WPMS for over 15 years across the higher ed web is an important archive, and all too much of it at the whim of the latest slash and burn campaign of the the newest leadership. This stuff is an important look at the impact of the digital shift on higher ed more broadly, and we can save it one site at a time (or even more if we have access 🙂 ). Thankfully the good folks at UMW have been hosting UMW Blogs with us forever, and I believe that archival project happening over the next 6 months will highlight a way that a school can both preserve what was and move forward at the same time.

This entry was posted in reclaim, Reclaim Edtech, WordPress, wordpress multi-user, wpmu and tagged , , , . Bookmark the permalink.

2 Responses to WordPress Multisite Migrations and the Meaning of Web Life

  1. Tom says:

    Amazing that theme still works. I really had almost no experience with themes or ACF when I built that, and the functionality requests just got more and more complicated.

    Great job with the migration and I’m happy to see they still see it as worthwhile.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.