How to make a metadata and detailview changes to be included in a manifest of a custom module


I have created a custom module which adds following things in the existing Accounts module

    • Add a button in the Accounts detail view(metadata)
  1. add a textfield inside the accounts detail view (views folder)

I have made above files to copy in to the custom accounts (suitable) folders and the module works fine but my problem is when the module is installing, It replaces the existing metadata and view.detail.php …which causes the previous changes on the accounts module are removed.

How can I include above changes in an upgrade safe way and not removing the existing files.