Skip to main content

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

  1. Unzip the blogs.dir Backup Zip
    • Unzip the blogs.dir backup zip created by UpdraftPlus. It contains subdirectories for each site on the network, like blogs.dir/2, blogs.dir/3, etc.
  2. Unzip the Uploads Backup Zip
    • Unzip your uploads backup zip, which contains a subdirectory named uploads.
  3. Create a sites Subdirectory
    • Inside the uploads directory, create a subdirectory named sites (i.e., uploads/sites).
  4. Move Contents to uploads/sites
    • Move the contents of the blogs.dir directory into uploads/sites. You will now have directories like uploads/sites/1, uploads/sites/2, etc.
  5. Zip the Uploads Directory
    • Zip up the uploads directory again. Ensure the zip file has one subdirectory at the top level (uploads).
  6. 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.