You can manage your indices using code with these API methods. We recommend making sure you back up any relevant content before testing any changes, such as rules and configuration. See this guide on the topic as well. We also recommend reviewing this article: Do you backup my data?