WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP S3 Backups] Doesn't backup uploaded images etc? (3 posts)

  1. danwarne
    Member
    Posted 4 years ago #

    This is a great plugin -- much better than the ones that email you backups daily, for example. It's a very elegant solution. However, as far as I can see, there is no way to make it upload the wp-content/uploads folder itself. That is to say, in the backups, that folder name is present, but its only contents is an SQL dump of the database, rather than the actual contents of the wp-content/uploads directory.

    In my view this is a major problem with the plugin, as the wp-content folder is where all your uploaded pictures etc go. If it was necessary to restore a backup of the blog, it wouldn't be much of a restoration if all pictures were missing!

    Am I missing something, or is this indeed a problem with the plugin?

    I did try emailing the author a while back, but didn't get a response.

    Does anyone know of any similar plugin that can upload to S3 and also handles the contents of the wp-content/uploads directory?

    http://wordpress.org/extend/plugins/wp-s3-backups/

  2. LionsAd
    Member
    Posted 4 years ago #

    Hi,

    This is indeed a problem with the plugin.

    However the functionality can be enabled without problems.

    Here is a small patch:

    --- wp-s3-backups.php.old	2009-12-06 06:45:39.000000000 +0100
    +++ wp-s3-backups.php	2009-12-06 06:45:48.000000000 +0100
    @@ -168,12 +168,10 @@
     								<input <?php if ( in_array('plugins', $sections) ) echo 'checked="checked"' ?> type="checkbox" name="s3b-section[]" value="plugins" id="s3b-section-plugins" />
     								<?php _e('Plugins folder', 'wp-s3-backups') ?>
     							</label><br />
    -							<!--
     							<label for="s3b-section-uploads">
     								<input <?php if ( in_array('uploads', $sections) ) echo 'checked="checked"' ?> type="checkbox" name="s3b-section[]" value="uploads" id="s3b-section-uploads" />
     								<?php _e('Uploaded content', 'wp-s3-backups') ?>
     							</label><br />
    -							-->
     						</p>
     					<?php endif; ?>
     					<p class="submit">
    @@ -246,8 +244,11 @@
     		}
     		if ( in_array('themes', $sections) ) $backups = array_merge($backups, WPS3B::rscandir(ABSPATH . 'wp-content/plugins'));
     		if ( in_array('plugins', $sections) ) $backups = array_merge($backups, WPS3B::rscandir(ABSPATH . 'wp-content/themes'));
    -		//if ( in_array('uploads', $sections) ) $backups = array_merge($backups, WPS3B::rscandir(ABSPATH . 'wp-content/uploads'));
    +		if ( in_array('uploads', $sections) ) $backups = array_merge($backups, WPS3B::rscandir(ABSPATH . 'wp-content/uploads'));
    
    +		// Remove zip file from backed up data
    +		$backups=array_diff($backups, array($file));
    +
     		$zip->create($backups, '', ABSPATH);
    
     		$s3 = new S3(get_option('s3b-access-key'), get_option('s3b-secret-key'));

    Apply on the command line via:

    patch -p0 < wp-s3-backups.php

    Best Wishes,

    Fabian

    --
    [moderated] no signatures here, see forum rules.

  3. markfarey
    Member
    Posted 4 years ago #

    This looks very promising, Can you please explain how to patch without Subversion?

    Thanks,
    Mark.

Topic Closed

This topic has been closed to new replies.

About this Topic