Add ability to rename databases and collections
It should be possible to rename databases and collections.
This feature is universal in all if not the vast majority of database products.
Lack of ability to rename anything makes it very hard for us to manage releases if we are adding new data. Currently, we have to create a copy of the existing database (which is a feat in itself, since this again is not core functionality), make the change there, and then re-point the website to the updated database. All this time, we are incurring extra costs and inconvenience.
Renaming things also allows us to correct typos, which happen from time to time!
The ability to rename databases and collections is not currently something that is in our road map.
Currently the way to accomplish this task in Cosmos DB is to create a new collection with the changed name then use bulk exec or change feed to populate it.
Thanks for your request and input on this. We may consider this for a future planning cycle.
Scott Springer commented
Allow me to explain a common scenario that makes this necessary functionality...
You're doing a cleanup of a fairly large portion of data in your collection. You download the data to a local JSON file that you process locally, and then you're ready to migrate that data back into production.
How do you do that in the most efficient way possible with as little downtime or potential impact as possible?
The EASIEST way to do it is to create a new collection with the same exact settings as the original collection that is being cleaned up with a temporary name. Migrate all of your collection data with the import utility or the tool of choice into the temporary collection. Once the migration is done and you're ready to move that data into production, rename the original collection to a new temporary name and rename the new collection to the name of the original collection.
If things go awry, you can simply move the names back. If things go well, then you can remove the original collection that now has the temporary name.
To do this any other way requires too much processing in the database (chewing up RUs) and is way too slow.
So explain to us, please, why this isn't on your road map?
It's been 3 years now and no activity on this. It is such a basic feature that should exist in the first place.
Cat Desmoulins commented
How comes such a basic metadata update isn't possible ?
How comes this fix hasn't been featured since 2 years ?
Please, explain ...
Guillaume Debra commented
When you use Azure DMS to migrate mongodb to CosmosDB (Mongo API) you cannot remap database name with an existing database.
You can only migrate to a new database with the same name on source.
Jason Thomas commented
This is the #12 item in votes. Unless votes are 100% bogus, how can this not be on your short term roadmap?
Jason Thomas commented
Not on your roadmap? This should never have been on your roadmap. It is something that should just have been done! With an answer like the one you just gave, it shows how useless this voting system is regarding what work you do. I don't know how many years DocumentDB, Cosmos has been in production, but it is lacking tons of general purpose features.
Items like this, you may consider basic and dumb. But these are also the ones that cost each of your users hours, days, and many times weeks of work. The approach you stated take TONS of time to learn and then use. A rename command however would only take a few seconds to execute. Using your current tooling, I'm likely to drop the entire collection yet again.
Or perhaps to move to a mature product like Mongo from the marketplace or just listen to my CEO who wants a move to AWS...
Chandan Gupta commented
When will this feature be in product roadmap? We accidentally had "." in the name and now datafactory linked service cannot connect the database. :(
They haven't figured out a way to monetize the rename yet, outside of forcing the use of bulk exec which sets your RU/s through the roof and leaves them there to maximize your bill
Marko Oja commented
"yes, we are also looking for this feature. we need to write to a new collection and once successful, we are planning to delete old collection and rename new to old. since azure search is configured to search the old collection"
We have exactly the same need. Please reconsider this valuable feature for enterprise architecture solutions.
Hacinto Moen commented
How is this BASIC functionality not available 2+ years later from the original post?
PLEASE ADD THIS BASIC FEATURE
Imre Pühvel commented
It doesn't even have to be a true rename of the same resource (which obviously could be complicated), but some tested comfortable migration automation, with suitable disclaimer regarding risks and most likely a small downtime is expected., would significantly reduce possible mishaps during manual resource reorganization.
Can we have this already? :)
yes, we are also looking for this feature. we need to write to a new collection and once successful, we are planning to delete old collection and rename new to old. since azure search is configured to search the old collection