There's two parts to this question.
First, how do you copy/move data with identity fields?
If you're going to be doing this regularly between two or more servers, you need to set up their identity seeds to be different. For example, if you have two servers sharing a table with a small amount of records, you might set one up with an identity seed of 1, and the other with an identity seed of 1,000,000. One server will start its identity field at 1 and go up, and the other at the higher number. Of course, you still have to keep an eye on this to make sure you don't end up with overlapping records.
Then, when you want to copy data from one server to another, you prefix your inserts with the SET IDENTITY_INSERT command as referenced here:
Then you can temporarily disable the identity field so you can pump data from one server to another.
Second, how do you copy/move data in general?
There's a bunch of ways to do this:
- SQL Server replication - can automatically sync data between multiple servers. It's built into the product, and it's flexible, but it's a pain in the rear to set up and manage. It's not for syncing dev/test environments like you're looking for.
- Scripting with SQL Server Management Studio - works, but it lacks flexibility, and it's a manual pain in the rear too.
- Data/schema comparisons with 3rd party products - tools like Toad for SQL Server will compare schemas and data between two servers and bring 'em in sync. (Disclaimer: I work for Quest, the makers of Toad.)
If you're moving data between production & dev/test, then restore the production data onto your dev/test server as another database name, and then do your database syncs there. It'll be faster, it won't impact your production box, and if you do something wrong (like sync data the wrong way) it won't wreck production.