Why the blogs directory is missing after a multisite restore
Before WordPress 3.5, a new WordPress Network (i.e., Multisite) installation stored media uploads (images, etc.) in the uploads directory for the “main” site on the network (site ID 1) and in a separate directory called blogs.dir for other sites. By default, blogs.dir was located at wp-content/blogs.dir, and UpdraftPlus’s multisite add-on backed it up separately.
From WordPress 3.5 onwards, a newly set up (i.e., not upgraded) multisite stores all blogs’ uploads in the uploads directory (wp-content/uploads by default). This change leads to fewer backup zips and more consistency.
Issue with Restoring Pre-WordPress 3.5 Multisite Backups
When you have a backup from a pre-3.5-era multisite and wish to restore it into a 3.5-or-later multisite, you encounter an issue: you have a backup of blogs.dir, but your new site has no such directory.
No Issue When Upgrading
This issue does not arise if you have only upgraded your pre-3.5-era multisite to 3.5 or later. In such cases, WordPress runs in a compatibility mode and retains the blogs.dir setup. Additionally, this issue is irrelevant if you are restoring a database from a pre-3.5-era multisite because WordPress’s compatibility handling will be triggered.
Solution: Restoring the blogs.dir Backup
To address this issue, follow these steps:
Step-by-Step Guide
- Unzip the
blogs.dirBackup Zip- Unzip the
blogs.dirbackup zip created by UpdraftPlus. It contains subdirectories for each site on the network, likeblogs.dir/2,blogs.dir/3, etc.
- Unzip the
- Unzip the Uploads Backup Zip
- Unzip your uploads backup zip, which contains a subdirectory named
uploads.
- Unzip your uploads backup zip, which contains a subdirectory named
- Create a
sitesSubdirectory- Inside the
uploadsdirectory, create a subdirectory namedsites(i.e.,uploads/sites).
- Inside the
- Move Contents to
uploads/sites- Move the contents of the
blogs.dirdirectory intouploads/sites. You will now have directories likeuploads/sites/1,uploads/sites/2, etc.
- Move the contents of the
- Zip the Uploads Directory
- Zip up the
uploadsdirectory again. Ensure the zip file has one subdirectory at the top level (uploads).
- Zip up the
- Import the Site Uploads
- Use the new uploads zip to import your site uploads.
Alternative Method
Alternatively, you can perform the restoration and then manually copy the contents from your blogs.dir backup zip into wp-content/uploads/sites on your new site.
Reverse Procedure
If you need to transfer content from a post-3.5-era setup into a pre-3.5 multisite, you can reverse the above procedure.