$alias="";
$table="";
$row="";
$table = $modx->getFullTableName("site_content");
$result = $modx->db->select("alias,id", $table, "", "", "");
while ($row = $modx->db->getRow($result)) {
$alias= strtolower($row[’alias’]);
$modx->db->update("alias=’".$alias."’", $table, "id = ".$row[’id’]."");
}