![]() ![]() Some may also point at the -db argument to mongorestore, however this, too, is deprecated and triggers a warning against use on non-BSON folder backups with a completely erroneous suggestion to " use -nsInclude instead". nsFrom 'byzmcbehoomrfjcs9vlj.*' -nsTo 'rita.*' Mongorestore -archive=backup.agz -gzip -drop \ ( Documentation.) Continuing with my above hypothetical (and extremely unreadable) example, to restore to a more sensical name, I invoke: Import your data, supplying -nsFrom and -nsTo arguments. For example, on one of my datasets, I have a collection with the namespace byzmcbehoomrfjcs9vlj.Analytics - that prefix ( actually the database name) will be needed in the next step. □Įquivalent behavior involves mongodump and mongorestore in a bit of a dance:Įxport your data, making note of the "namespaces" in use. I've updated SERVER-701 with my notes and incredulity. Other answers point at copyDatabase, which is no longer an option as the functionality has been removed in 4.0. The currently accepted answer at time of writing is factually correct and offers some interesting background detail as to the excuse upstream, but offers no suggestions for replicating the behavior. There is no mechanism to re-name databases. ![]() To do it offline, it would require re-writing every single database file to accommodate the new name, and at that point it would be as slow as the current "copydb" command. There would be absolutely no way to do this on a live system. For replica sets the above would need to be done on every replica node, plus on each node every single oplog entry that refers this database would have to be somehow invalidated or rewritten, and then if it's a sharded cluster, one also needs to add these changes to every shard if the DB is sharded, plus the config servers have all the shard metadata in terms of namespaces with their full names. This is just to accomplish a rename of a single database in a standalone mongod instance. ![]() contents of system.namespaces and system.indexes (or their equivalents in the future).internal unique names of each collection and index.every single numbered file for the collection.In MMAPv1 files, the namespace (e.g.: llection) that describes every single collection and index includes the database name, so to rename a set of database files, every single namespace string would have to be rewritten. It does not store any personal data.Unfortunately, this is not an simple feature for us to implement due to the way that database metadata is stored in the original (default) storage engine. The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. The cookie is used to store the user consent for the cookies in the category "Performance". This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. The cookies is used to store the user consent for the cookies in the category "Necessary". ![]() The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". The cookie is used to store the user consent for the cookies in the category "Analytics". These cookies ensure basic functionalities and security features of the website, anonymously. Necessary cookies are absolutely essential for the website to function properly. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |