• Does anybody know a solution to make a backup only for a single blog in a multisite installation?

    I have a subdirectories-based network installation, and wish to give a way for each blog administrator to make a backup (DB & files) only for its own blog.

Viewing 15 replies - 16 through 30 (of 35 total)
  • so you could tell the user to go to yourdomain.com/username/backup.php and run a script that would do all that. or place a link in the users admin menu. that would go to like themes/yourtheme/backup.php

    so by utilizing the export.php you could just auto some of its functions to grab posts, pages, comments, custom fields, terms, navigation menus and custom posts customize the function to drop it in the uploads dir and then zip the entire thing?

    Thread Starter narcisgarcia

    (@narcisgarcia)

    I’ve discovered with this SQL command:
    SELECT * FROM wp_blogs;
    That the field “blog_id” can be used to distinct all the tables related to a sub-site.

    For example:

    SELECT blog_id, path FROM wp_blogs;
    +---------+----------------------+
    | blog_id | path                 |
    +---------+----------------------+
    |       1 | /                    |
    |       3 | /myfriend/           |
    +---------+----------------------+

    Then I can list site’s tables:

    SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = "multisitedatabase" AND TABLE_NAME LIKE "wp_3_%";
    +-------------------------+
    | TABLE_NAME              |
    +-------------------------+
    | wp_3_commentmeta        |
    | wp_3_comments           |
    | wp_3_ec3_schedule       |
    | wp_3_links              |
    | wp_3_options            |
    | wp_3_postmeta           |
    | wp_3_posts              |
    | wp_3_socialslider       |
    | wp_3_term_relationships |
    | wp_3_term_taxonomy      |
    | wp_3_terms              |
    +-------------------------+

    I suppose these are all the tables to be exported for a complete backup (database part).

    Thread Starter narcisgarcia

    (@narcisgarcia)

    With this last information and exploring filesystem content, I deduce that all attached/accessory files for blog nr.3 are stored together in this directory:
    /wp-content/blogs.dir/3/

    the directory structure is (for uploads) ;

    wp-content/blogs.dir/USER##/files/YYYY/MM/

    example:

    wp-content/blogs.dir/5/files/2011/06/

    whats confusing me is that the image i used to test the path was automatically duplicated into 4 images;

    img.png (original upload)
    img-150×70.png
    img-300×67.png
    img-32×32.png

    so when compiling the backup you may want to have a selector that only grabs the original file, for images at least.

    Plus the size increase on the server for 1 image is absurd. The original image was 7119k , the generated 3 images that was not requested by the user = 18073k

    i don’t understand the logic in turning one small image (7119k) into 25192k

    hrmm…

    WordPress builds different thumbnails for every image you upload.

    apparently builds larger versions if the image is smaller.

    this should be an option to be able to turn off.

    $createZip->get_files_from_folder('/wp-content/blogs.dir/" . the_id . "/', '" . the_id . "/');

    something like this could work using the method above, you just need a function to assign the_id to the proper user

    I do know it goes in order by users who have signed up, so if you have users that don’t have sites, they are also counted, and in the directory they will be skipped. (unless they have the ability to upload something)

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    mdevaney – Please don’t post multiple times in a row within minutes of each other. You’re tripping the spam filter. Make one, longer, post please ??

    WordPress builds different thumbnails for every image you upload.

    Also your theme may create more images as needed.

    Thread Starter narcisgarcia

    (@narcisgarcia)

    Is necessary to talk about sites (blogs) not users.

    A site can have multiple users, and viceversa.

    @ipstenu, it wasn’t my posts it was my edits that were causing the spam filter.

    @narcisgarcia not really. i don’t imagine you want your user to be able to backup their profile.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Well you COULD want multiple users to be able to backup their site, but I’d be pretty gun-shy about letting non super-admins have access to anything that made massive SQL queries.

    Also given that the export would need to extract info from the shared wp_users and wp_usermeta table, I think I’d just tell them they can’t.

    apparently builds larger versions if the image is smaller.

    this should be an option to be able to turn off.

    Read this: https://electrokami.com/coding/wordpress-disable-automatic-image-thumbnail-resizing/

    Thread Starter narcisgarcia

    (@narcisgarcia)

    If 1 site has more that one administrator, it’s normal that any of those administrators can make a backup of the entire site or blog.

    This is necessary both in simple-site installation and in multi-site blogs. The only restrictions needed is that the administrators in 1 multisite blog cannot backup data from other blogs in the same multisite installation, and may not also backup the users accounts that have access to multiple blogs.

    But the current situation is: no files, no preferences, no plugin options,..

Viewing 15 replies - 16 through 30 (of 35 total)
  • The topic ‘Separated multisite backups’ is closed to new replies.