Say you have a view of nodes, and want to change it to another entity, say a custom entity like in my case “dH Feature”. Of all the settings that can be changed in the Drupal Views Admin UI – the base content type, or base table, cannot. Once you’ve created your view, you’re stuck with it. A workaround is to use “Views Export” and “Import”, changing the base table in code. For my example, I started with a view that:
//$view->base_table = ‘node’;
$view->base_table = ‘dh_feature’;
Et voila! Now my view can be constructed accordingly. Caution of course, you have to do a bit more replacing if the fields that you’ve added do not exist in the destination Entity type.