def readProjects(self):
    
    project_list = Project.objects.all()
    for pr in project_list:
      channel_list = Channel.objects.filter(project_id = pr.project_name)
      for ch in channel_list:
        if ch.channel_type == OLDCHANNEL and "_" in ch.channel_name:
          print ch.channel_name, ch.channel_type
          conn = MySQLdb.connect(host=pr.host, user = settings.DATABASES['default']['USER'], passwd = settings.DATABASES['default']['PASSWORD'], db=pr.project_name)
          ch.channel_name = ch.channel_name.replace('_','-')
          cursor = conn.cursor() 
          cursor.execute("SELECT chanid FROM channels where chanstr=%s", [ch.channel_name])
          id = cursor.fetchone()
          if id is not None:
            cursor.execute("DELETE FROM channels WHERE chanstr=%s", [ch.channel_name])
            ch.channel_name = ch.channel_name.replace('-','_')
            cursor.execute("INSERT INTO channels (chanstr,chanid) VALUES (%s,%s)", (ch.channel_name,id))
            conn.commit()
          conn.close()
          ch.save()
Read all the Projects and check through their channels
dataset/ETHPy150Open neurodata/ndstore/util/channelconversion.py/channelConversion.readProjects