Connecting views to another Drupal database I have a need to display views using an old Drupal database.  These views are already created, so I exported them and dropped the export code into a custom module hook_views_default_view, put in the necessary return, changed the view name, updated the paths, etc.  So, now I have two Views showing exactly the same dataset.

I need the newly created one to query against an old database; both databases have exactly the same structure. I have the old database setup in settings.php and, I thought, all I needed to do was add $view-&gt;database = "oldlife". That's not working - I'm getting the exact same data in both views (two different paths).

This is the code, minus all the handlers and unnecessary stuff:

function lwg_old_db_views_api() {
    return array(
            'api' =&gt; 3,
            'path' =&gt; drupal_get_path('module', 'lwg_old_db'),
    );
}

function lwg_old_db_views_default_views() {
    $view = new view();
    $view-&gt;name = 'commerce_vbo_views_orders_oldlife';
    $view-&gt;description = 'Display a list of orders for the store admin.';
    $view-&gt;tag = 'commerce';
    $view-&gt;database = 'oldlife';
    $view-&gt;base_table = 'commerce_order';
    $view-&gt;human_name = 'Orders';
    $view-&gt;core = 0;
    $view-&gt;api_version = '3.0';
    $view-&gt;disabled = FALSE; 
    /**
      * many lines of $handler-&gt; stuff
      */
    $handler = $view-&gt;new_display('page', 'Page', 'page_1');
   $handler-&gt;display-&gt;display_options['path'] = 'list-all-nodes';
   $views[$view-&gt;name] = $view;
   return $views;
}
Have a look at this module, it can do the job for you.

https://www.drupal.org/project/web_widgets