If you have a test instance of FogBugz with a separate database, you may want to be certain that it will not interfere with anything that your production instance is using. The sanitizing script covered in this article ensures your primary database remains safe and unaffected.
This article is useful for L2 agents and admins who are experienced with scripting and databases. Do not run this script against your active FogBugz database, this deletes data from the database without backing it up!
Use this sanitizer script to ensure no conflict with mailboxes. It will set the correct auth type so you can get into your test instance without a password. This is useful if you want to periodically refresh the data in your test instance with the latest backup from your production instance.
If you are running FogBugz On Site, there may be more to do depending on how you have your test installation configured. Contact us, and we will be happy to make sure you have got everything you need!
-- Remove pending outgoing mail
DELETE FROM MailQueue;
-- Turn off outgoing emails to FogBugz Users
UPDATE Person SET fNotify = 0, fEscalationReport = 0;
-- Disable Mailboxes so you don't pull emails into test
UPDATE Mailbox SET fDeleted = 1;
-- Unsubscribe all users
DELETE FROM Subscriptions;
-- Don't ever send email
UPDATE Setting SET sValue = 'NONE' WHERE sKey= 'sSMTPServer';
-- Use Passwords instead of e.g., LDAP
UPDATE Setting SET sValue = '1' WHERE sKey= 'fPasswordEnable';
UPDATE Setting SET sValue = '0' WHERE sKey= 'iAuthType';
-- Update the base url so internal links and redirects don't point to production (you'll need to supply an appropriate value)
UPDATE Setting SET sValue = 'http://test-fogbugz.example.com' WHERE sKey = 'sUrlPrefixEmail';
Please notice the following "side-effects" of the configurations mentioned above:
1) DELETE FROM MailQueue: will remove all mail pending in the queue so the system does not shows an error message in the notification area.
2) UPDATE Mailbox SET fDeleted = 1: deletes any mailbox configuration from the system to prevent the server to attempt retrieving live email cases.
2) UPDATE Setting SET sValue = 'NONE' WHERE sKey= 'sSMTPServer': this will disable the send mail functionality. This has the following side effects:
a) The system stops sending e-mail notifications.
b) This also disables the subscription option on cases.
c) And this disables the 'forgot password' function (user will be redirected to the Homepage).