Is it possible to extract last month's values from a MySQL server and build a new database from those values?

Solution 1:

If I understood correctly you are planning to make a separate DB copy for each development environment.

While this might be feasible with small databases, it won't work that well with big DBs. So unless you have a really good reason to setup a separate DB for each environment it might be better to consider having a single copy of development database and setting all development environments to use it.

This approach will allow you to refresh development DB with the latest data periodically and if someone messes it up you can just refresh it again.

Also imagine the situation where your developers start to work on some new project which requires new tables to be created. If you have a single copy of development DB you (or devs) will need to create those tables and fill them with test data just once. Now imagine devs realize that initial table structure is not optimal and needs to be changed. Again this will need to be done on a single DB a opposed to possibly tens of environments.

This is the approach I saw being used for big projects time and time again and most of the time it works pretty well.

Solution 2:

This is extremely dependent on the kind of data in the database. In some cases, it might be as easy as

select * from table where date > ....

while in other cases, it's impossible to separate this because of the structure of the data. In the end, it will likely be a mix and very hard to get right.