Database reset

In case there is a need to reset a database and return it to its original state, it can be done using the steps below. The steps below assume that you are using the OTB MariaDB container, but the concepts apply to all databases.

First, you need to login to a database. In command line, login into your DB to perform sql. Below, the commands are given for MariaDB in container.

  • SSH into your database container by first getting the CONTAINER ID using:
docker ps | grep mariadb
  • Connect to the container using the following command. You should copy the container id form the previous step.
docker exec -it [database container id] bash

Note: If you run MariaDB in docker container run the following command

docker exec -it [database container id] mysql -u IAMUSER -p openiam

But if you use another DB type or other deployment, please follow a regular approach to connect to the DB.

Afterwards, apply sql statements from the desired file. The files can be found in conf/schema/db-cleanup/.