php-redis-migrate-sessions icon indicating copy to clipboard operation
php-redis-migrate-sessions copied to clipboard

Rewrote script in PHP to fix various errors from redis. Also faster

Open aziraphale opened this issue 9 years ago • 3 comments

I was having some problems running this script - I would get various errors back from redis that seemed to suggest that the line length specified for the data line was incorrect. This mostly/entirely happened with sessions created by phpMyAdmin - i.e. very long files, with lots of complex PHP serialization strings.

I tried to fix the bash script for a while, but there were parts where I wasn't confident about what was going on, so I rewrote the whole thing in PHP (which I figured was fine in this case, since it's a PHP-related script, so anyone wanting to run it would probably already have PHP installed). My PHP version not only migrates my ~600 sessions flawlessly, without getting stuck on the phpMyAdmin sessions, but it also runs a lot faster (I'm seeing it execute in under 1 second for ~600 sessions, while the original script took around 4-5 seconds to run).

aziraphale avatar Feb 20 '17 14:02 aziraphale

hey man, its all GREAT that you fixed it, however I stop working with PHP and this script it not in use (by me anymore), feel free to fork it and apply your changes to it !!

renasboy avatar Feb 21 '17 07:02 renasboy

That's cool, no worries :) I figure that having this pull request here may help people find my version if they have the same problems that I did. No need to merge it or anything :)

aziraphale avatar Feb 21 '17 10:02 aziraphale

Yep you are right? coolio, nice work !!

renasboy avatar Feb 21 '17 11:02 renasboy