{"id":189,"date":"2020-11-05T16:02:04","date_gmt":"1999-01-01T00:00:00","guid":{"rendered":"http:\/\/naveedulhaq.com\/?p=189"},"modified":"2021-01-24T18:18:36","modified_gmt":"2021-01-24T18:18:36","slug":"a-handy-script-to-anonymize-epicommerce-data","status":"publish","type":"post","link":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/","title":{"rendered":"A handy script to anonymize Epicommerce data"},"content":{"rendered":"\n<p>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&#8217;s information to be copied in these environments. <\/p>\n\n\n\n<p>So I created a handy script to anonymize customer and order data. Few assumptions;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>This script purposely does not remove data because we might need to investigate a production issue with access to database records.  <\/li><li>This script does not override the customer&#8217;s usernames.  <\/li><li>you are using default identity provider.<\/li><\/ul>\n\n\n\n<p>Script<\/p>\n\n\n\n<pre><code>Update &#91;OrderGroup]\nSet CustomerName = 'John Smith'\nwhere\nCustomerName &lt;&gt; 'John Smith'\n\nUpdate &#91;OrderGroupAddress]\nSet FirstName = 'John', LastName = 'Smith', Line1 = 'Address Line 1', City = 'City', PostalCode = 'Postcode', &#91;Name] = 'John Smith'\nwhere\n&#91;Name] &lt;&gt; 'John Smith'\n\nUpdate &#91;Orders]\nSet ZipCode = 'Postcode', SalesName = 'John Smith', Street = 'Street name', City = 'City', DeliveryName = 'John Smith', Address_Street = 'Street name', Address_City = 'City'\nwhere\nSalesName &lt;&gt; 'John Smith'\n\nUpdate cls_Contact\nSet FullName = 'John Smith', FirstName = 'John', LastName = 'Smith' , BirthDate = '1990-01-01', Email = 'john.smith@test.com'\nwhere\nFullName &lt;&gt; 'John Smith'\n\nUpdate cls_Address\nSet &#91;Name] = 'John Smith', FirstName = 'John', LastName = 'Smith' , Line1 = 'Address Line 1', City = 'City', PostalCode = 'Postcode'\nwhere\n&#91;Name] &lt;&gt; 'John Smith'<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":65,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[13,22,17],"class_list":["post-189","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-episerver","tag-episerver","tag-episerver-commerce","tag-sql-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>A handy script to anonymize Epicommerce data - Naveed Ul-Haq&#039;s blog<\/title>\n<meta name=\"description\" content=\"A handy script to anonymize Epicommerce data the test environment - Naveed Ul-Haq&#039;s Blog - Episerver, .Net Core, Cloud (Azure, AWS) &amp; More\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A handy script to anonymize Epicommerce data - Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"og:description\" content=\"A handy script to anonymize Epicommerce data the test environment - Naveed Ul-Haq&#039;s Blog - Episerver, .Net Core, Cloud (Azure, AWS) &amp; More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/\" \/>\n<meta property=\"og:site_name\" content=\"Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"article:published_time\" content=\"1999-01-01T00:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-24T18:18:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/01\/episerver.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"230\" \/>\n\t<meta property=\"og:image:height\" content=\"230\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Naveed Ul-Haq\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Naveed Ul-Haq\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/a-handy-script-to-anonymize-epicommerce-data\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/a-handy-script-to-anonymize-epicommerce-data\\\/\"},\"author\":{\"name\":\"Naveed Ul-Haq\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"headline\":\"A handy script to anonymize Epicommerce data\",\"datePublished\":\"1999-01-01T00:00:00+00:00\",\"dateModified\":\"2021-01-24T18:18:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/a-handy-script-to-anonymize-epicommerce-data\\\/\"},\"wordCount\":108,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/a-handy-script-to-anonymize-epicommerce-data\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/episerver.jpeg\",\"keywords\":[\"episerver\",\"Optimizely Customized Commerce\",\"Sql Server\"],\"articleSection\":[\"Optimizely\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/a-handy-script-to-anonymize-epicommerce-data\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/a-handy-script-to-anonymize-epicommerce-data\\\/\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/a-handy-script-to-anonymize-epicommerce-data\\\/\",\"name\":\"A handy script to anonymize Epicommerce data - Naveed Ul-Haq&#039;s blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/a-handy-script-to-anonymize-epicommerce-data\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/a-handy-script-to-anonymize-epicommerce-data\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/episerver.jpeg\",\"datePublished\":\"1999-01-01T00:00:00+00:00\",\"dateModified\":\"2021-01-24T18:18:36+00:00\",\"description\":\"A handy script to anonymize Epicommerce data the test environment - Naveed Ul-Haq's Blog - Episerver, .Net Core, Cloud (Azure, AWS) & More\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/a-handy-script-to-anonymize-epicommerce-data\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/a-handy-script-to-anonymize-epicommerce-data\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/a-handy-script-to-anonymize-epicommerce-data\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/episerver.jpeg\",\"contentUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/episerver.jpeg\",\"width\":230,\"height\":230,\"caption\":\"episerver\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/episerver\\\/a-handy-script-to-anonymize-epicommerce-data\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A handy script to anonymize Epicommerce data\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\",\"name\":\"Naveed Ul-Haq's blog\",\"description\":\"AI, Optimizely, Azure &amp; more\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.naveedulhaq.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\",\"name\":\"Naveed Ul-Haq\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"caption\":\"Naveed Ul-Haq\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\"},\"description\":\"I lead engineering delivery teams for digital commerce and digital experience platforms, combining hands-on architecture experience with strong delivery governance. Over 20+ years, I\u2019ve built and led cross\u2011functional teams (engineering, BA, QA) delivering modern cloud solutions on Azure, microservices, APIs and eCommerce\\\/CMS platforms. My recent focus includes AI-enabled commerce automation: product ingestion and enrichment workflows, content optimisation for SEO and shopping feeds, and agentic tooling to improve marketing and accessibility workflows. I\u2019m passionate about building high-performing teams, establishing quality\\\/release standards, and delivering measurable outcomes across performance, reliability, and speed of change.\",\"sameAs\":[\"https:\\\/\\\/www.naveedulhaq.com\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/naveedulhaq\\\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A handy script to anonymize Epicommerce data - Naveed Ul-Haq&#039;s blog","description":"A handy script to anonymize Epicommerce data the test environment - Naveed Ul-Haq's Blog - Episerver, .Net Core, Cloud (Azure, AWS) & More","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/","og_locale":"en_GB","og_type":"article","og_title":"A handy script to anonymize Epicommerce data - Naveed Ul-Haq&#039;s blog","og_description":"A handy script to anonymize Epicommerce data the test environment - Naveed Ul-Haq's Blog - Episerver, .Net Core, Cloud (Azure, AWS) & More","og_url":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/","og_site_name":"Naveed Ul-Haq&#039;s blog","article_published_time":"1999-01-01T00:00:00+00:00","article_modified_time":"2021-01-24T18:18:36+00:00","og_image":[{"width":230,"height":230,"url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/01\/episerver.jpeg","type":"image\/jpeg"}],"author":"Naveed Ul-Haq","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Naveed Ul-Haq","Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/#article","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/"},"author":{"name":"Naveed Ul-Haq","@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"headline":"A handy script to anonymize Epicommerce data","datePublished":"1999-01-01T00:00:00+00:00","dateModified":"2021-01-24T18:18:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/"},"wordCount":108,"commentCount":0,"publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/01\/episerver.jpeg","keywords":["episerver","Optimizely Customized Commerce","Sql Server"],"articleSection":["Optimizely"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/","url":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/","name":"A handy script to anonymize Epicommerce data - Naveed Ul-Haq&#039;s blog","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/#primaryimage"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/01\/episerver.jpeg","datePublished":"1999-01-01T00:00:00+00:00","dateModified":"2021-01-24T18:18:36+00:00","description":"A handy script to anonymize Epicommerce data the test environment - Naveed Ul-Haq's Blog - Episerver, .Net Core, Cloud (Azure, AWS) & More","breadcrumb":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/#primaryimage","url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/01\/episerver.jpeg","contentUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/01\/episerver.jpeg","width":230,"height":230,"caption":"episerver"},{"@type":"BreadcrumbList","@id":"https:\/\/www.naveedulhaq.com\/index.php\/episerver\/a-handy-script-to-anonymize-epicommerce-data\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.naveedulhaq.com\/"},{"@type":"ListItem","position":2,"name":"A handy script to anonymize Epicommerce data"}]},{"@type":"WebSite","@id":"https:\/\/www.naveedulhaq.com\/#website","url":"https:\/\/www.naveedulhaq.com\/","name":"Naveed Ul-Haq's blog","description":"AI, Optimizely, Azure &amp; more","publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.naveedulhaq.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9","name":"Naveed Ul-Haq","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","caption":"Naveed Ul-Haq"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g"},"description":"I lead engineering delivery teams for digital commerce and digital experience platforms, combining hands-on architecture experience with strong delivery governance. Over 20+ years, I\u2019ve built and led cross\u2011functional teams (engineering, BA, QA) delivering modern cloud solutions on Azure, microservices, APIs and eCommerce\/CMS platforms. My recent focus includes AI-enabled commerce automation: product ingestion and enrichment workflows, content optimisation for SEO and shopping feeds, and agentic tooling to improve marketing and accessibility workflows. I\u2019m passionate about building high-performing teams, establishing quality\/release standards, and delivering measurable outcomes across performance, reliability, and speed of change.","sameAs":["https:\/\/www.naveedulhaq.com","https:\/\/www.linkedin.com\/in\/naveedulhaq\/"]}]}},"_links":{"self":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/comments?post=189"}],"version-history":[{"count":0,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/189\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media\/65"}],"wp:attachment":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media?parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/categories?post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/tags?post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}