Run masquerade against a .sql file instead of database
alexhert opened this issue · 4 comments
is it possible to run this agains an mysqldump ? it would be great to masquerade an existing mysql backup instead of changing data on database itself.
I agree but I have no clue how to make that happen.
Another approach could be made possible using https://github.com/ifsnop/mysqldump-php. Another lib https://github.com/heyday/laravel-anonymised-sql-dumps uses it.
@toonvd that looks interesting. But that will mean a very big rewrite since we now generate queries and run them against MySQL
If we were to use mysqldump-php
, we'll have to rewrite everything to transform callables like this https://github.com/ifsnop/mysqldump-php#changing-values-when-exporting
Doable, but a lot of work. Not sure if it's worth the hassle.
It depends on your requirements indeed, for me, a stream using an anonymous mysqldump would mean a lot less i/o when migrating DBs. Also, it avoids anonimising the wrong (production) DB by mistake. I guess this could be a separate project.