简体   繁体   中英

Best way to copy an azure cosmos db to a dev cosmos db at regular intervals?

I'm looking to update my dev db to match my prod db at regular intervals (say weekly). Is there a way to do this using Azure itself or do I need to write a script to do this?

Thank you!

I have an idea upon your case but I'm not sure if it fits what you want. This is an answe r from @David Makogon to other question. How do you think about exporting and importing documents manually? Or trying to create an function to execute these operations which can be activated by time trigger.

I have tried migration tool, it's ok to import data. 在此处输入图像描述

You can use Copy activity and then use schedule trigger to execute it in Azure Data Factory.

1.select upsert as write behavior. 在此处输入图像描述

2.add a schedule trigger and set running interval according to your need. 在此处输入图像描述

I would suggest Azure Data Factory.

Probably the easiest way these days would be to have the production account set up to use the continuous backup model .

This allows self service point in time restore to a new Cosmos account and can be set to either 30 day retention (chargeable) or 7 day (currently free).

There is a restore cost based on the GB size of data restored but this may well be cheaper than paying for the Request Units involved in reading batches from the source and writing them to the destination (unless the container is big and you are just writing incremental changes).

The main caveats from this are

  • The restore each time will be to a different account so the account you regard as "your dev account" will change over time and you'll need to update connection strings etc.
  • Moving from periodic backup model to continuous is not reversible so you need to make sure you read up on the limitations and are happy with them (incompatibility with analytical store and multi region write are probably the main ones).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM