Select to view content in your preferred language

How to restore to the original records using database replication?

832
4
01-14-2012 03:41 PM
JackZHANG
Frequent Contributor
Hi,
I have two databases, one parent one child, one-way replication from parent to child.

The child database is used for field data capture, however, the data (feature points) sometimes were deleted by the field walkers accidentally. So, is there a way to restore the deleted features in the child database but also keep the changes of the other features made by field walker? I have tried using Parent to Child synchronization but doesn't seems it restore the deleted data. Any suggestions would be appreciated!
0 Kudos
4 Replies
JakeSkinner
Esri Esteemed Contributor
The fastest way to do this would be to recreate the replica:

1.  Unregister the replica from each geodatabase
2.  Delete the feature class in the child geodatabase
3.  Replicate the data from the parent to the child geodatabase again
0 Kudos
JoeBorgione
MVP Emeritus
The fastest way to do this would be to recreate the replica:

1.  Unregister the replica from each geodatabase
2.  Delete the feature class in the child geodatabase
3.  Replicate the data from the parent to the child geodatabase again


But won't step #2 delete the features added to the child by the field walker?

Before you delete the child feature class, may I suggest you make a comparison of the parent to the child.  Make a spatial selection of everything in the child that is the same in parent;  then switch the selection of the child, and you should have just the field walker additions.  Write those to a feature class so you can load them or otherwise get them into the parent.

Hope this helps-
That should just about do it....
0 Kudos
JackZHANG
Frequent Contributor
Thanks JS and jborgion.

jborgion you're right, on step #2 it will delete everything that field walkers captured, which is not what we want. The idea is to run this daily check automatically at the background. Probably can build a model based on your suggestion. However, then it's really no need to use database replication.

I thought this (restore the deleted records to Child) could be easily done by Database Replication, as it assigns a GlobalID to each record in the parent, then it shouldn't too hard to compare the two and transfer whatever is missing from the parent to Child.

But won't step #2 delete the features added to the child by the field walker?

Before you delete the child feature class, may I suggest you make a comparison of the parent to the child.  Make a spatial selection of everything in the child that is the same in parent;  then switch the selection of the child, and you should have just the field walker additions.  Write those to a feature class so you can load them or otherwise get them into the parent.

Hope this helps-
0 Kudos
JoeBorgione
MVP Emeritus
Thanks JS and jborgion.

jborgion you're right, on step #2 it will delete everything that field walkers captured, which is not what we want. The idea is to run this daily check automatically at the background. Probably can build a model based on your suggestion. However, then it's really no need to use database replication.

I thought this (restore the deleted records to Child) could be easily done by Database Replication, as it assigns a GlobalID to each record in the parent, then it shouldn't too hard to compare the two and transfer whatever is missing from the parent to Child.


With DataBase replication, the process looks for changes.  If your field walkers delete a record in the child that would be recored as a change to the parent when you sync your child to the parent. Since you are running with a one way replication, this isnt' an issue.

However, since your original data in the parent remains unchanged, nothing gets passed from parent to child when the child is the only one getting edited while you are only syncing in a one way direction, parent to child.

I'm going to think about your workflow.  One would think there is a solution for you!
That should just about do it....
0 Kudos