The easiest way is to copy the ‘collection.nml’ file in your Traktor directory. This file is located in the Traktor directory for the most recent version of Traktor installed or in the custom directory you selected in Tractor’s preferences. You can compress/zip it too to make sure nothing happens the backup.
To restore the information, copy this file back into the Traktor directory and, using the Terminal app, run this command:
touch <path to the traktor directory>/collection.nml
(you would of course replace the path above by the correct one for your situation).