Just got a new DEV server set up How do I load a subset of my production data?

  • Hi all,

    The company I'm working for has finally, after a year of me asking, set up a 2019 Standard Edition DEV SQL server for us  so we don't do development in prod anymore.

    We have seven databases (Only two are important) with associated procs, tables, views, etc...  that I want to move data from.

    Procs and views etc... are no problem. but i don't want to bring along the 10+ years of data from the tables. maybe just the last two years worth.  one DB has 215 tables and the other 860 tables.

    What's the best way of doing this? Are there any tools that I can use?

    Thanks for any assistance.

  • You could use

    https://docs.dbatools.io/Copy-DbaDbTableData

    with a query as a source.

    Or export/import the data as csv from a restored backup

    https://learnsql.com/blog/how-to-export-csv-from-sql-query/

  • How big are the DBs ? Do you need to subset all the tables, or just a few big ones ? Do they have referential integrity to complicate subsetting ?  How important is it that the major tables have the same cut-off ? Exactly the same, or "close enough" ?

    Assuming you will want to refresh Dev occasionally saving all the steps in a SSIS package or stored procedure will help for next time.

    Various ways depending on size & scope of DB and tables.

    1 way would be to restore the whole Prod DB to Dev, if you have room, set to simple recovery, then delete rows older than 2 years. That way, all the load is on the Dev server and you may not be very concerned about how long it takes.

    • This reply was modified 2 years, 12 months ago by  homebrew01.
    • This reply was modified 2 years, 12 months ago by  homebrew01.
    • This reply was modified 2 years, 12 months ago by  homebrew01.
    • This reply was modified 2 years, 12 months ago by  homebrew01.
    • This reply was modified 2 years, 12 months ago by  homebrew01.
    • This reply was modified 2 years, 12 months ago by  homebrew01.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply