Developer forum

Forum » Development » Restoring production database to dev/test

Restoring production database to dev/test

Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Hi all,

I' wondering how other handle the resotring of databases to dev/test from production. I find it makes live a lot easier if I can work on new features, or debuging existing issues if I have a recent copy of production, many times issues are related to some misconfiguraiton in the database. 

However I'm unsure how to best handle a couple of things:

  • On production sites I prefer to Force SSL, how would I unforce that programatically given the fact I have no SSL setup on dev
  • Same for domain names, the primary domain for example does not normally exist on my local dev or test
  • How can I quicly anonymize sensitive data like users and orders?

Hopefully someone has some good tips :-)

Cheers,

Justin


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

Hi Justin,

A lot of this is stored in the database so you can write SQL scripts to do that. Here's a start:

UPDATE Area SET 
 AreaSSLMode = 1, -- 1 Standard, 2 Force SSL, 3 Un-force SSL
 AreaDomainLock = ''

DELETE FROM dbo.EcomOrderDebuggingInfo
DELETE FROM dbo.EcomOrderLines
DELETE FROM dbo.EcomOrders
DELETE FROM dbo.AccessUserAddress
DELETE FROM dbo.AccessUser WHERE AccessUserType IN (5,15)  -- SystemAdministrator = 1, Administrator = 3, Editor = 4, Default = 5, ExtranetUser = 15

 

Note that there's a lot more: payment gateways, shipping providers, live integration and SMTP settings to name a few. Most are in the database, but some are in files in disk.

Imar

Votes for this answer: 1

 

You must be logged in to post in the forum