Index: wp-admin/network/upgrade.php
===================================================================
--- wp-admin/network/upgrade.php	(revision 32987)
+++ wp-admin/network/upgrade.php	(working copy)
@@ -47,7 +47,9 @@
 	case "upgrade":
 		$n = ( isset($_GET['n']) ) ? intval($_GET['n']) : 0;
 
-		if ( $n < 5 ) {
+		$n_sites = intval( apply_filters( 'ms_upgrade_sites', 5 ) );
+
+		if ( $n < $n_sites ) {
 			/**
 			 * @global string $wp_db_version
 			 */
@@ -55,7 +57,7 @@
 			update_site_option( 'wpmu_upgrade_site', $wp_db_version );
 		}
 
-		$blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5", ARRAY_A );
+		$blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, {$n_sites}", ARRAY_A );
 		if ( empty( $blogs ) ) {
 			echo '<p>' . __( 'All done!' ) . '</p>';
 			break;
@@ -97,11 +99,11 @@
 			do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] );
 		}
 		echo "</ul>";
-		?><p><?php _e( 'If your browser doesn&#8217;t start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&amp;n=<?php echo ($n + 5) ?>"><?php _e("Next Sites"); ?></a></p>
+		?><p><?php _e( 'If your browser doesn&#8217;t start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&amp;n=<?php echo ($n + $n_sites) ?>"><?php _e("Next Sites"); ?></a></p>
 		<script type="text/javascript">
 		<!--
 		function nextpage() {
-			location.href = "upgrade.php?action=upgrade&n=<?php echo ($n + 5) ?>";
+			location.href = "upgrade.php?action=upgrade&n=<?php echo ($n + $n_sites) ?>";
 		}
 		setTimeout( "nextpage()", 250 );
 		//-->
