Is there a way of renaming a RavenDB database from code by using ClientAPI and operations?
A database cannot be renamed from code.
You need to 'soft' delete the database and then recreate it on the same path with a new name.
See full explanation in: RavenDB Book - Renaming a database