vote up 2 vote down
star

How can I import a FogBugz On Demand trial database into MySQL?

flag

3 Answers

vote up 1 vote down
check

1. Log into your hosted account as a Site Administrator. Click Settings at the top right, then "My On Demand Account", and click the download link for "MySQL format". Download and save the .sql file to your computer.

2. Install FogBugz fully and get it working (even add a test case).  Remember the FogBugz user and password that you set for the database. Before you go on, stop the FogBugz Maintenance Service.

3. Once its working, log into mysql. You should be able to log on using the fogbugz user and password at this point.  The instructions assume your FogBugz database is called 'fogbugz'.  If not, replace fogbugz with the name of your database.

mysql> drop database fogbugz;
mysql> create database fogbugz;
mysql> use fogbugz;
mysql> source /path/to/trial.sql.dat
mysql> grant all on fogbugz.* to fogbugzuser identified by 'fogbugzpassword';
mysql> grant all on fogbugz.* to fogbugzuser@'localhost' identified by 'fogbugzpassword';

Note the ' around the 'localhost' part.  You can replace localhost with the server name if your FogBugz server is on a different machine.  You should replace all italicized values above with values corresponding to your setup and environment.

Note the use of the "source" command above. Do not simply paste the contents of the .sql file into a MySQL GUI and run it. Tests have shown that this results in corrupted cases under certain circumstances.

4. Then go back into FogBugz through your web browser. You will have to enter your order info for licenses again.

5. If you are running on Unix or Mac, edit the Setting table in your FogBugz database so that the row with fPasswordEnable as the sKey has a sValue of 0 (zero).

mysql> use fogbugz;
mysql> UPDATE Setting SET sValue = '0' WHERE sKey = 'fPasswordEnable';

This turns off passwords so you can log into your account (the passwords are stored in a different format on Windows vs. Unix/Mac and the hosted server is Windows).  You will need to reset all the user passwords using FogBugz (or go into the database and set them all to 'AA' which is synonymous for a blank password).

To turn passwords back on, set the value of the key  fPasswordEnable back to 1 (one).

mysql> use fogbugz;
mysql> UPDATE Setting SET sValue = '1' WHERE sKey = 'fPasswordEnable';

Windows: If you are running MySQL on Windows, please see this guide.

link|flag
vote up 0 vote down

If you get errors during the "source" command, your instance of MySQL might be running in SQL strict mode. This needs to be disabled for FogBugz databases to operate correctly. (Strict mode is useful for when you want the database to offer all kinds of constraints; we put these constraints in our code, not the database schema.)

To disable strict mode, log into MySQL and run:

SELECT @@global.sql_mode;

If you get anything other than a blank string back, run:

SET @@global.sql_mode = '';

Note: This setting might be set in your MySQL configuration files, so if you restart MySQL, strict mode might be re-enabled, which will interfere with the normal operation of FogBugz. Check your my.cnf or my.ini file for lines that set the sql_mode setting.

link|flag
vote up 0 vote down

If your plugins are broken after import, re-install them per this question.

link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.