Support » Networking WordPress » Restoring single sites from backup

  • Hi
    I have a multisite install with about 12 active sites on a Ubuntu server. I have a daily backup in place of the entire server.

    My concern is in the case of accidental deletion or major damage to an individual site, how I can reconstruct it from the backup…

    Has anyone done a step-by-step HowTo guide for this process? It seems it would be invaluable.

    I am aware that I would need to restore all the wordp<n>_* tables for the appropriate site ID n and files to the wp-content/blogs.dir/<n> but there is also the matter of modifying the ‘wordpblogs’ table to add the site, and presumably restoring values to the ‘wordpusers’, wordpusermeta, wordpsitemeta and other tables.

    Even better would be a way of automating this, but maybe a bit much to ask! I guess a guide to the process of extracting a single site from a multisite file backup might be a useful starting point – any ideas?

    Thanks,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    My concern is in the case of accidental deletion or major damage to an individual site, how I can reconstruct it from the backup…

    Restore the DB tables and the wp-content/uploads/sites/# folder

    That’s about the best you can do :/ You shouldn’t have to touch the rest unless someone actually does DELETE the site from the network admin, at which point… you’re kind of in a really, really, bad place.

    If that happened to me, I’d make a NEW site, import the old tables, and then rename those tables to the new blog ID. So that means if someone delete wp_4_* I would make a new site (wp_10_), DROP the wp_10_ tables, re-upload the wp_4_, rename them to wp_10_

    Then search/replace those tables for wp-content/uploads/sites/4 to wp-content/uploads/sites/10 and upload the media to the 10 folder via FTP.

    If you have no practical need for users to delete their own sites, I offer an ounce of prevention:

    remove_submenu_page( ‘tools.php’, ‘ms-delete-site.php’ );

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Restoring single sites from backup’ is closed to new replies.