Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create production database sample for testing?

Is there a tool (for PosgreSQL, ideally), which can make a small, but consistent sample of a big database?

The this is we need a testing database, but we don't want to fully copy the production one. First, because it is too big and second, the nature of testing implies that the testing database will be recreated several times in the process.

Obviously, you can not simply take random rows from some tables, because this will violate the hell out of foreign keys and what not. So, I wonder is there a tool available that can do that?

like image 487
Maxim Sloyko Avatar asked Oct 07 '10 14:10

Maxim Sloyko


1 Answers

What about generating some mock data with a tool like databene benerator, just as much as you want, and store them for reuse.

like image 110
Pascal Thivent Avatar answered Oct 02 '22 08:10

Pascal Thivent