I'll try to be as simple as possible since many people already gave conceptual reasoning.
Think of PI being 8 just as that molecule having pH of 8. and now since the solution has pH5, solution works as acid and the molecule as base. Now, as a base molecule being in comparably acidic solution, it will now be protonated which will make the molecule positively charged. Now what will a positively charge molecule be attracted to? Negatively charged electrode. - we'll come back to this.
and the question is, what is the negative electrode? does it matter whether it's voltaic or electrolytic cell? well, to make it simple, electron always flow from anode(-) to cathode(+). [duh]
don't get confused whether it's electrolytic so now cathode acts anode???? what the hell is going on????
the reason for interchanged electrode is only because the direction of electron flow has been flipped from voltaic to electrolytic; ie. discharging to recharging of battery. That said, it never happens that an anode now acts as cathode but still emits electrons, no.
so back to the main question, the positively charged molecule of yours will move towards anode which is emiting electrons thus negatively charged, no matter what type of cell you have. I wish this could help. :]
the last paragrpah doesnt make too much sense to me...or im reading it wrong if pI=8 and pH=5 then it will move toward the ANODE IN GALVENIC but the CATHODE IN ANODE.....so it does matter what type of cell u have doesnt it?