This post is part of a series on Drupal update hooks. See Configuration management: update hooks for lazy developers for an introduction to configuration management via update hooks. Views are complex and editing a view through the UI is rarely a quick task. Having to recreate these changes on multiple environments is enough to make any developer cringe. Thankfully, views has an excellent export system that makes updating views easy using update hooks. The best workflow I've found is to make any changes to your view through the UI and then use the export feature as a reference for your update hook. Example:
/**
 * Update the events view.
 */
function monarch_extras_update_7005() {
  $view = views_get_view('events', TRUE);
 
  // Add a filter to the default display.
  $default_options = &$view->display['defaults']->display_options;
  $default_options['filters']['type'] = array(
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'value' => array('event' => 'event'),
    'group' => '0',
    'expose' => array('operator' => FALSE),
  );
 
  // Events page updates.
  $page_options = &$view->display['page_1']->display_options;
 
  // Add a title to the page and override the default display.
  $page_options['defaults']['title'] = FALSE;
  $page_options['title'] = 'Events';
 
  // Front page block updates.
  $block_options = &$view->display['block_2']->display_options;
 
  // Add no results behavior.
  $block_options['empty'] = array(
    'area' => array(
      'id' => 'area',
      'table' => 'views',
      'field' => 'area',
      'empty' => TRUE,
      'content' => t('No upcoming events.'),
      'format' => '4', // Plain text.
    ),
  );
 
  // Add a sort and override the default display.
  $block_options['defaults']['sorts'] = FALSE;
  $block_options['sorts']['field_event_date_value'] = array(
    'id' => 'field_event_date_value',
    'table' => 'field_data_field_event_date',
    'field' => 'field_event_date_value',
    'order' => 'ASC',
  );
 
  // Use the default filters for the block display.
  $block_options['defaults']['filters'] = TRUE;
 
  // Save the view and clear the views cache.
  $view->save();
  cache_clear_all('events', 'cache_views_data', TRUE);
}