Programmatically change view path without views_alter I have a PHP script in which I want to set the path to a view.
For example on site1 I want the news to be at /news/index.html and on site2 I want the news to be at /blog/news/page/1.
The sites are sharing the modules folder so I cannot do this from the modules files. So I have a script in which I'm doing my initial setup for each website. Everything works perfect but the view path is not saved.

1. $view = views_get_view('news');
2. $view-&gt;display['page']-&gt;handler-&gt;options['options']['path'] = $my_path;
3. $view-&gt;save();


I also tried to use $view->override_path instead of line 2 but it's still not working.
I managed to find the right way. The following code works great for me.

$view = views_get_view($view_name, TRUE);
$view-&gt;display['page']-&gt;display_options['path'] = $new_path;
views_save_view($view);