Skip navigation.
Home

Migrating from MySQL 4.x to 5.x

If you have MySQL 4.x from a previous version of Inventory, you must upgrade to MySql 5.x.

While upgrading MySQL brings the wonderful benefits of having a more recent version of MySQL, an unadorned attempt to upgrade MySQL will take away access to the Asset Trustee Database. The inventory becomes blank--an asset manager's worst nightmare! Following just a few steps, however, the asset trustee database can be exported and reimported, keeping all its information intact.

Here's what you need to begin:
-Root password to your MySQL database
-MySQL package installers from our site.
-Terminal; it's nice to have root access as well
-For troubleshooting, I recommend downloading a MySQL Administration Tool.

I. Backing up the Asset Trustee Database
This quick command in the terminal creates an SQL dump file in your / directory (you could put it somewhere else if you'd like; just specify a path). If your MySQL has no root password, leave out the -p.

Code:
/usr/local/mysql/bin/mysqldump -u root -p asset_trustee > /ATBackup.sql
Enter password:


If you would like to test the file, delete a system or two in the Inventory, and load the dump with this command:

Code:
/usr/local/mysql/bin/mysql -u root -p asset_trustee < /ATBackup.sql
Enter password:


The systems reappear upon a browser refresh.

II. Upgrading MySQL
Install the new version of MySQL and the StartupItem, and restart the machine. When you try to open http://localhost, you'll find this unhappy message:

There's no need to worry; this is expected. We have to recreate Asset Trustee's MySQL user. Open the file below with a text editor (I suggest TextWrangler or BBEdit. Textedit will work, but you will then need to temporarily change the permissions on the /Library/Webserver/prefs folder in order to save changes)

/Library/WebServer/prefs/settings.xml

and find these lines:

Delete the username and password, so that it looks like this:

Save the file. Now, go to http://localhost and create Asset Trustee's MySQL user. It's not too important what the username and password are unless people are currently using this account to access MySQL. But don't log in quite yet!

Finally, restore the database dump:

Code:
/usr/local/mysql/bin/mysql -u root -p asset_trustee < /ATBackup.sql


Upon login, the AT Database will be back in all its glory!