How to rename a project in OpenShift

Solution Verified - Updated -


  • Red Hat OpenShift Container Platform (RHOCP)
    • 3.X
    • 4.X


After a project creation, it is needed to change its name.



  • There is a workaround to get the same effect of renaming:

    1. Backup up the content of the project.
    2. Restore it into a new project as outlined in the following section of the Day Two operations guide
  • One can also modify a project's display name and description, editing the following annotations:

$ oc edit project myproject
  annotations: "rename-me" "rename-me"


  • There is no verified way for renaming the projects in RHOCP 4.X.
  • Also there will be data loss if pods are using any persistent storage.

Root Cause

It is not possible to rename projects as the Name field is primarily intended for creating idempotence and configuration definition and therefore cannot be updated.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.


After all resources in the old namespace are exported as yaml files they have built in old namespace name in each yaml file. So, when creating new-project with a new name and running "oc create -f *.yaml -n {new_project_name}" all resources are unable to be created, because of a wrong namespace inside exported yaml files. Is there any way to change old namespace name to a new one without manually editing every yaml file exported from an old project/namespace?