Support

Akeeba Backup for WordPress

#30780 Multisite restore single site

Posted in ‘Akeeba Backup for WordPress’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

WordPress version
n/a
PHP version
n/a
Akeeba Backup version
n/a

Latest post by damnsharp on Friday, 18 January 2019 02:41 CST

damnsharp
Hi great team,
Is it possible to restore a single site from a multisite back-up to a newly installed multisite?
I think it is difficult or not possible, but I am not sure.
And when it is not possible do you know a different way?

Thanks!
Damiaan.

nicholas
Akeeba Staff
Manager
In short, while it is somewhat possible it's complicated enough that I wouldn't recommend it unless there's a really good reason (i.e. someone is paying you per hour to do this).

WordPress does not really create multiple sites in a multisite installation. It has a single installation and uses different sets of database tables to make it look like there are multiple sites. Information about these tables and how they correlate to individual "sites" are stored in the actual (main) site's database. That's why WordPress now uses the terminology blog network instead of "multisite" and refers to each individual "site" as a blog.

What this means is that you cannot extract a single blog from the network since its data is entangled with that of the blog network (main) site which is in its turn entangled with all the other blogs. To make matters worse, WordPress holds theme and plugin configuration parameters in both the blog network site and the individual blogs. Since this data is serialized PHP data it is very complicated to merge them. For the same reason you can't directly convert from a blog network to a single site installation, dropping other blogs in the process.

What you can do is restore the entire blog network locally, e.g. using MAMP, XAMPP or WAMPserver as your local server environment, then follow these complicated instructions. I would call this process the diametrically opposite of user-friendly but at least it clearly demonstrates why such a feature is not implemented in an automated fashion...

Alternatively, you can use WordPress export and import features to export the content of a blog and import it into a new, single site installation. The obvious problem with that approach is that everything that's not a WordPress post needs rebuilding from scratch.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

damnsharp
Thank you Nochilas for your complete answer!
I thought so it is difficult to move a single site out of a WP Multisite installation.

Why I asked the question is because of the following.
I have a problem with a multisite with images.
I want to backup/restore a multisite to a new location and remove all sites (except one site).
That would not be a problem, but the multisite has a configuration problem (I think). It stores all the images in public_html/wp-content/blogs.dir/
That's an old way of storing media files I have read.
I think it is better that the media files are stored in /public_html/wp-content/uploads/sites/

When I look in htaccess file I see the followin line, which I think is the culprit:
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

I am curious, is in your opinion wrong to nowadays the use of blogs.dir o.k. or wrong?
And is it solvable to move images to uploads/sites and use that folder as upload dir?

Thanks!

nicholas
Akeeba Staff
Manager
The issue you have is not with Akeeba Backup. Unfortunately I cannot help you with it. It looks like you have a really old multisite installation dating back to when there were two separate WordPress releases, the regular and the multisite. That was before my time with WordPress; we were a 100% Joomla shop back then.

I think you're better off asking these questions at the WordPress forum or a local Facebook group. There are people who have been around that long and possibly know how to help you with that.

Another approach is doing what I described and then doing two things. First move the files into the wp-content/uploads folder. Then do a mass replacement in the database to change /files/ with /wp-content/uploads/. However, you need a tool which won't bork your database's serialized data. We have been working on a plugin which does exactly that. If you're interested let me know, I'll send you an installable build. FWIW it's the same data replacement engine powering Akeeba Backup's restoration script (ANGIE) since December 2018 so it's actually been battle tested already :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

damnsharp
Hi Nicholas, I understand.
And yes please, when you can send me the installable build for WP of the replace software, that would be great.

Have a nice day.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!