Restore Production Database into Dev Environment

Modified on Mon, 19 Feb 2024 at 12:49 PM

It may be useful to make a clone of the production ManagementStudio database into a development environment. It's important that the following SQL script is run against the restored database in the development environmnt before the dev instance of ManagementStudio is started:



-- Delete License Key

DELETE FROM [dbo].[zIntnl_Setting-Global] WHERE [Name] = 'License_CustomerId'

DELETE FROM [dbo].[zIntnl_Setting-Global] WHERE [Name] = 'License_Key'

 

 

-- Delete Send Email Server Name

DELETE FROM [dbo].[zIntnl_Setting-Global] WHERE [Name] = 'Email_Smtp_Server'

 

 

-- Delete Public Url (pointing to Prod)

DELETE FROM [dbo].[zIntnl_Setting-Global] WHERE [Name] = 'Public_Url'

 

 

-- Delete any Emails that are in the send queue

DELETE FROM [dbo].[Msg_EmailCentre] WHERE [IsSent] = 0 

 

 

-- Delete any notifications emails users have subscribed to

DELETE FROM [dbo].[MyPrefs_SubscriptionEvent]

 

 

-- Turn off all Scheduled Tasks

UPDATE [dbo].[Registry_Schedule] SET [IsEnabled] = 0

 

 

-- Turn off all PowerShell Scripts

UPDATE [dbo].[Registry_Script] SET [IsEnabled] = 0

 

 

-- Disable Survey and Test Sign-Off Reminder Emails

UPDATE [dbo].[Survey-Config] SET [SendReminderEmailAfterXDays] = 0




Once the above has been completed, the following steps will need to be taken:

  • Add a licence
  • Add SMTP email server details (if required)
  • Add the public URL
  • Create test accounts (if required)