databaserenameravendb4

How to rename RavenDB database using ClientAPI?


Is there a way of renaming a RavenDB database from code by using ClientAPI and operations?


Solution

  • 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