Maintenance Mode
Some tasks need to be performed in maintenance mode, such as restoring database, resetting administrator password, etc. Below explains how to enter into this mode for different installation flavors:
-
If you are running OneDev as docker container:
- Stop the container
- Run below command to enter into container:
docker run -it --rm -v <data dir>:/opt/onedev 1dev/server bash
Here
<data dir>
represents the directory storing OneDev data- Change into directory /opt/onedev in the container to perform various maintenance tasks
-
If you are deplolying OneDev into Kubernetes cluster:
- Change to directory /path/to/k8s-resources/maintenance, and run command
kubectl apply -k .
- Run command
kubectl get pods -n onedev
to check pod name of onedev - Run below command to enter into onedev pod container (replace with the actual pod name obtained in previous step):
kubectl exec -it -n onedev <onedev-pod-name> bash
- Change to directory /opt/onedev in the container to perform various maintenance tasks
- After performing maintenance tasks, you may start OneDev in normal mode by changing to the production folder and run
kubectl apply -k .
- Change to directory /path/to/k8s-resources/maintenance, and run command
-
If you are running OneDev on virtual machine/bare metal machine:
- Stop OneDev service
- Change to the directory where OneDev is installed to perform maintenance tasks