While working with Episerver commerce a lot of times we come across a challenge to copy production website data down to integration and pre-production environment. Since integration is normally a Dev environment and pre-production a test environment we do not want customer’s information to be copied in these environments.

So I created a handy script to anonymize customer and order data. Few assumptions;

  • This script purposely does not remove data because we might need to investigate a production issue with access to database records.
  • This script does not override the customer’s usernames.
  • you are using default identity provider.


Update [OrderGroup]
Set CustomerName = 'John Smith'
CustomerName <> 'John Smith'
Update [OrderGroupAddress]
Set FirstName = 'John', LastName = 'Smith', Line1 = 'Address Line 1', City = 'City', PostalCode = 'Postcode', [Name] = 'John Smith'
[Name] <> 'John Smith'
Update [Orders]
Set ZipCode = 'Postcode', SalesName = 'John Smith', Street = 'Street name', City = 'City', DeliveryName = 'John Smith', Address_Street = 'Street name', Address_City = 'City'
SalesName <> 'John Smith'
Update cls_Contact
Set FullName = 'John Smith', FirstName = 'John', LastName = 'Smith' , BirthDate = '1990-01-01', Email = 'john.smith@test.com'
FullName <> 'John Smith'
Update cls_Address
Set [Name] = 'John Smith', FirstName = 'John', LastName = 'Smith' , Line1 = 'Address Line 1', City = 'City', PostalCode = 'Postcode'
[Name] <> 'John Smith'

Categorized in: