Manual:Update.php

Details
update.php checks if the schema>Special:MyLanguage/Manual:Database layout|MediaWiki database schema needs to be updated in order to work with the current version of MediaWiki. You should run  after each upgrade>Special:MyLanguage/Manual:Upgrading|upgrade of MediaWiki or after the update or install of an extension that requires a schema update. Most extensions that require schema updates will say so in their documentation.

From the browser
If you do not have access to the command line of your server, then use the web updater to run the update script.


 * '''&rarr;

webupd>Manual:Upgrading#Web browser|Web updater '''

From the command line
From the command line, or an SSH shell or similar:

 $ php update.php   may exit with errors, leaving the database in an inconsistent state. Always backup>Special:MyLanguage/Manual:Backing up a wiki|backup the database before running the script!
 * Change to the maintenance directory
 * Run the update script:

Use the following on  instances (from within your vagrant ssh).  $ mwscript update.php

Parameters
This script offers several parameters (generic, script dependent and script specific) which may be required in some wiki environments.

<?php $db_hostname = 'localhost'; $db_database = 'admin'; $db_username = 'root'; $db_password = '';

$db_server = mysql_connect($db_hostname, $db_username, $db_password) or die("Unable to connect to MySQL: " . mysql_error);

mysql_select_db($db_database); $result = mysql_query("SELECT * FROM video_adv");

if(isset($_POST['submit']))

{ $id                = $_POST['id']; $start             = $_POST['start']; $end               = $_POST['end']; $date_start        = $_POST['date_start1']; $date_end          = $_POST['date_end1']; $video_ad          = $_POST ['video_ad']; $start1            = $_POST['start1']; $end1              = $_POST['end1']; $date_start1       = $_POST['date_start1']; $date_end1         = $_POST['date_end1']; $video_ad1         = $_POST['video_ad1']; $start2           = $_POST['start2']; $end2             = $_POST['end2']; $date_start2      = $_POST['date_start2']; $date_end2        = $_POST['date_end2']; $video_ad2        = $_POST['video_ad2']; $start3           = $_POST['start3']; $end3             = $_POST['end3']; $date_start3      = $_POST['date_start3']; $date_end3        = $_POST['date_end3']; $video_ad3        = $_POST['video_ad3']; mysql_query("UPDATE video_adv SET  start = '$start', end ='$end', date_start ='$date_start',  date_end ='$date_end',  video_ad ='$video_ad',		                                               start1 = '$start1',  end1 = '$end1',  date_start1 = '$date_start1',  date_end1 = '$date_end1', video_ad1 = '$video_ad1',								                       start2 = '$start2',  end2 = '$end2',  date_start2 = '$date_start2',  date_end2 = '$date_end2', video_ad2 = '$video_ad2',								                       start3 = '$start3',  end3 = '$end3',  date_start3 = '$date_start3',  date_end3 = '$date_end3', video_ad3 = '$video_ad3'		 WHERE 'id'='$id' ")  or die(mysql_error); }

while ($row = mysql_fetch_array($result)) { $id                = $row['id']; $start             = $row['start']; $end               = $row['end']; $date_start      = $row['date_start1']; $date_end        = $row['date_end1']; $video_ad          = $row ['video_ad']; $start1            = $row['start1']; $end1              = $row['end1']; $date_start1       = $row['date_start1']; $date_end1         = $row['date_end1']; $video_ad1         = $row['video_ad1']; $start2           = $row['start2']; $end2             = $row['end2']; $date_start2      = $row['date_start2']; $date_end2        = $row['date_end2']; $video_ad2        = $row['video_ad2']; $start3           = $row['start3']; $end3             = $row['end3']; $date_start3      = $row['date_start3']; $date_end3        = $row['date_end3']; $video_ad3        = $row['video_ad3']; ?>     " method="post" > data of first video  <input name="id" type="hidden"  size="20" value="<?php echo $id; ?> " > date start: <input name="date_start"  type="date" value="<?php echo $date_start; ?>" > date end: <input name="date_start"  type="date" value="<?php echo $date_end; ?>" > start: <input name="start"  type="time" value="<?php echo $start; ?>" > end: <input name="end"  type="time" value="<?php echo $end; ?>" > video_ad: <input name="video_ad"  type="text" value="<?php echo $video_ad; ?>" > data of secand video date start1: <input name="date_start1"  type="date" value="<?php echo $date_start1; ?>"> date end1: <input name="date_end1"  type="date" value="<?php echo $date_end1; ?>"> start1: <input name="start1"  type="time" value="<?php echo $start1; ?>"> end1: <input name="end1"  type="time" value="<?php echo $end1; ?>"> video_ad1: <input name="video_ad1"  type="text" value="<?php echo $video_ad1; ?>"> data of third video date start2: <input name="date_start2"  type="date" value="<?php echo $date_start2; ?>"> date end2: <input name="date_end2"  type="date" value="<?php echo $date_end2; ?>"> start2: <input name="start2"  type="time" value="<?php echo $start2; ?>"> end2: <input name="end2"  type="time" value="<?php echo $end2; ?>"> video_ad2: <input name="video_ad2"  type="text" value="<?php echo $video_ad2; ?>"> data of fourth video date start3: <input name="date_start3"  type="date" value="<?php echo $date_start3; ?>"> date end3: <input name="date_end3"  type="date" value="<?php echo $date_end3; ?>"> start3: <input name="start3"  type="time" value="<?php echo $start3; ?>"> end3: <input name="end3"  type="time" value="<?php echo $end3; ?>"> video_ad3: <input name="video_ad3"  type="text" value="<?php echo $video_ad3; ?>"> <input type="submit" name="submit" value="submit" />

<?php } ?>

Script specific parameters
skip countdown sequence do not purge objectcache table. Normally update.php</tt> purges the objtable>Special:MyLanguage/Manual:objectcache table</>|objectcache (generally contains the parser cache and the messages cache), restable>Special:MyLanguage/Manual:Msg resource table</>|msg_resource and linkstable>Special:MyLanguage/Manual:Msg resource links table</>|msg_resource_links (these are used for <tvar|loader></> message caching and are cleared in 1.21 and later) tables in the database, if you don't want to purge this table, use the <tvar|nopurge>--nopurge</tt></> option. Update shareddb>Special:MyLanguage/Manual:Shared_database</>|shared tables as well. Run this script even if it is disabled by configuration options. Skips compatibility checks

Extensions can install/update their schemas using <tvar|updhook></> hook.