none
How can I move data from tablestorage on production to development storage and back

    Question

  • Hello,

    I'm looking for a simple solution. NOT a product as I am aware of the products out there. From what I have seen there seem to be a few codeplex projects that have not been updated for quite some time.

    Is there no simple way to export the content of a table to XML and then import this?


    Hopefully something will be made available if not already.

    Thanks,

    Saturday, April 23, 2011 8:19 AM

Answers

  • Since you don't know the model of your table beforehand, you would need to go with something like a generic entity. May I recommend that you take a look at source code for Azure Storage Explorer (http://azurestorageexplorer.codeplex.com) and look for GenericEntity.cs class. When you fetch the data from a table in production, you will create a collection of this generic entity and the upload this collection in development storage.

    Hope this helps.

    Thanks

    Gaurav

    • Marked as answer by Wenchao Zeng Monday, May 02, 2011 2:39 AM
    Sunday, April 24, 2011 2:46 AM

All replies

  • Hi Gordon,

    One way to achieve what you're doing is work directly with REST API for table storage. First you would need to invoke the List Entities functionality (http://msdn.microsoft.com/en-us/library/dd179421.aspx). The response body from Table Storage service is an ATOM feed formatted XML document. This will give you the XML document you would need to restore the data later on. Since your table can potentially contain very large amount of entities and table service returns up to 1000 entities at a time, I would recommend that you save each response (containing up to 1000 entities) in a separate XML document. This will come in handy when you're importing the data back into table storage as parsing large XML documents is a big pain from performance point of view. For importing, you would want to go through these XML files and then create an XML payload. I would recommend that you look at Entity Group Transaction feature in Azure Table Storage (http://msdn.microsoft.com/en-us/library/dd894038.aspx). You can create an XML paylod and import those entities back in Azure Table Storage.

    Hope this helps.

    Thanks

    Gaurav Mantri

    Cerebrata Software

    http://www.cerebrata.com

     

    Saturday, April 23, 2011 9:26 AM
  • What I am looking into now is setting up connections to my production and my development storage accounts. Then for each table I would get the data from production, place this into a class and then upload the same data to the development account.

    BUT I am not sure of how to code this. Hopefully someone has tried this and has some examples.


    Gordon

    Saturday, April 23, 2011 6:38 PM
  • Since you don't know the model of your table beforehand, you would need to go with something like a generic entity. May I recommend that you take a look at source code for Azure Storage Explorer (http://azurestorageexplorer.codeplex.com) and look for GenericEntity.cs class. When you fetch the data from a table in production, you will create a collection of this generic entity and the upload this collection in development storage.

    Hope this helps.

    Thanks

    Gaurav

    • Marked as answer by Wenchao Zeng Monday, May 02, 2011 2:39 AM
    Sunday, April 24, 2011 2:46 AM