Manipulating Views Programmatically

To create a custom presentation management dashboard for Showerma v2 I have learned how to clone, edit and delete views in Drupal 7 programmatically. Now I am going to share the results of my research.

There is plenty of articles about Views hooks on the net, but this one is not about the hooks.

The content is valid for Drupal 7. However, I suppose that the main principles and approaches are still valid and somehow applicable for Backdrop and even Drupal 8 because I don't think they have already changed the Views architecture significantly.

Let us get started from the simplest task.

Clone an existing view

Cloning views is easier than you could imagine.