Deleting Portal persistence data

Document ID : KB000121557
Last Modified Date : 27/11/2018
Show Technical Document Details
Question:
APIM Support team. I have a question about API Dev Portal EE v4.2. If I want to delete the Portal docker container, I can simiply run the "docker stack rm portal". But I'd like to know the command line to delete the container as well as persistence data. I'd like to start the Portal with factory default setting. (If we use docker-compose, we can run with the following command option to delete the persistence volume " down --volumes") 

 
Answer:
Delete the Portal – removes all unused containers, images, and selected volumes
These commands are used when you want ot remove portal deployment (as root)
 
docker stop ${docker ps -q)
docker rmi -r ${docker images -q)
docker volumes ls
docker volume rm $(docket volume ls -q)
docker system prune
systemctl restart docker
 
NOTEL if you type “docker images” and “docker volumes ls” there should be nothing listed
OR
Remove stack “Portal”
This is used when you want to reset the portal stack (portal services) and the volumes but keep images
docker stack rm portal
docker rm $(docker ps -qa)
docker volume rm $(docker volume ls -q)
 
NOTE: Removes the PortgreSQL database