This is just a quick post which explains how you can rename an existing database in RavenDB. Actually you can’t. What you can apply is the following procedure:
- Create a new destination database in RavenDB with the new desired name
- Export the source database into a RavenDB dump
- Import the dump into the destination database
This operation is an offline operation. You could also use the replication bundle to replicate information from one database into the other on the same server but this only works when you already have setup the source database with the replication bundle activated. I’m not going to cover replication in this blog post.
Let’s us assume your source database has similar data like mine:
Create a new destination database called “destination”. Now here is your chance to enable all the bundles you previously wished you had 😉
Goto the Tasks tab of the source database and export the database including everything necessary like attachements, indexes etc. into a dump file.
Switch back to the destination database, goto the Tasks tab and choose to import the previously exported dump file.
After the successful import all documents, indexes etc. are moved into the new destination database.
RT @planetgeekch: Rename a database in RavenDB #ravendb http://t.co/I1BvtNmKkk