Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn a huge live database into a small testing database?

I'm currently developing an API for a company that didn't do a very good job on maintaining a good test database with test data. The MySQL database structure is quite big and complicated and the live database should be around 160-200GB.

And because I'm quite lazy and don't want to create test data for all the table from scratch, I was wondering what would be the best way to turn such a big database into a smaller test database that keeps all data with their relationships in a correct form. Is there an easy way to this with some kind of script that checks the database model and knows what kind of data it needs to keep or delete when reducing the database to smaller size?

Or am I doomed and have to go through the tedious task of creating my own test data?

like image 367
Mexxer Avatar asked Jan 09 '14 11:01

Mexxer


1 Answers

Take a look at Jailer which describes itself as a "Database Subsetting and Browsing Tool". It is specifically designed to select a subset of data, following the database relationships/constraints to include all related rows from linked tables. To limit the amount of data you export, you can set a WHERE clause on the table you are exporting.

The issue of scrubbing your test data to remove customer data is still there, but this will be easier once you have a smaller subset to work with.

like image 185
Richard Neish Avatar answered Sep 19 '22 11:09

Richard Neish