MongoDB – Alternatives to copydb and shutdown in ApsaraDB

mongodb

List of below mentioned commands are not supported on ECS – ApsaraDB for MongoDB.

copydb
clone
clean
shutdown
repairDatabase
repairCursor

Is there alternate available for the same ?

I appreciate any assistance with this.

Best Answer

The commands you've listed are administrative commands that you should expect to be limited when using a managed Database-as-a-Service provider. I would anticipate further restriction for commands that are either subsumed by the managed platform functionality (for example, replica set configuration) or likely to introduce performance/stability issues. For comparison, MongoDB Atlas also has a list of unsupported commands for shared or dedicated clusters.

In the event your deployment gets in state where admin help is needed, the provider's support staff can presumably escalate as required.

For context on the specific commands you've listed:

  • clone and copydb are officially deprecated since MongoDB 4.0 but also discouraged in older server versions. These commands do not produce point-in-time snapshots of the source database and will introduce performance and concurrency problems (such as blocking foreground index builds). Use mongodump and mongorestore instead.
  • clean is an internal command with no end user utility.
  • shutdown doesn't make sense for a managed service where you don't have direct access to restart a MongoDB process. It is possible the provider's UI or API provides an option to restart or suspend a member of your deployment but reasonable not to have direct access.
  • repairDatabase and repairCursor should only be used as a last resort to salvage data if you don't have a viable backup for your deployment. This is definitely a scenario where you'd be working with the provider's support team to get your deployment back online with the most reasonable approach.