Duplicating Data from Dev to Test and Production

Hi :slight_smile:

I have a case where I want to duplicate the content from my dev database to the test and production databases.

The situation is that I have an app in the dev environment where, through testing, I have generated quite a lot of high-quality data. This took some time, and I would save time if I didn’t have to do the same in the test and production environments.

So my questions are:

  1. Is there a smoother way to transfer data between environments than building functionality for export and import using the “Export data” and “Import data” action nodes?
  2. What is the best way to ensure that all references from my dev environment remain intact when importing the data? Do I have to set up these references manually after importing?

Best regards,
Sigurd

Hi,

To answer your two questions:

  1. You can create a service endpoint that reads and returns all your data. In Test, you can call the Dev endpoint with an web request and get all your data as JSON back.
  2. As long as you map the ID of the incoming object to the ID property on your new object, then the reference will still be valid. The reference is just a string with some extra validation. As long as the foreign key points to a primary key in another table, then the reference will be valid.

So simply create a service with all your datasources set to Read All Objects. Then call that service from Test with an Web Request and map the data. (Remember to map the ID prop to keep your references)

// Erik

1 Like