upgrade script for new privilege system