# data migration

**URL:** https://forum.servoy.com/t/data-migration/14971
**Category:** Classic Servoy
**Created:** [November 4, 2011, 1:33am UTC](https://forum.servoy.com/t/data-migration/14971 "2011-11-04T01:33:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rogel](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rogel](https://forum.servoy.com/u/rogel)
#### Post date: [November 4, 2011, 1:33am UTC](https://forum.servoy.com/t/data-migration/14971/1 "2011-11-04T01:33:50Z")

</div>

hi!

how can I copy data from oldtable1 to newtable1 if there is a duplicate record and its child records using servoy foundsets?

contact  
-idcontact  
-name

phone  
-idphone  
-phonenumber  
-idcontact

current data contents  
idcontact name idphone phonenumber  
1 servoy 1 12345  
2 dell 2 23456  
3 intel 4 34567

old data  
idcontact name idphone phonenumber  
1 hp 1 98765

new data should have  
idcontact name idphone phonenumber  
1 servoy 1 12345  
2 dell 2 23456  
3 intel 3 34567  
4 hp 5 98765  
where: idcontact became 4 because 3 is the max while idphone became 5 because 4 is the max  
the old data is stored in tablename.xml format.
