Not too long ago I posted about how to remove (detatch) content databases safely from the SharePoint Farm. to enable you to move/replace databases between Web Applications and or Database Servers. One of the reasons why it is important to use the preparetomove command is to prevent problems when you reattach these databases to the farm.
Usually these problems show themselves via the event viewer in the form of event ID 5555 and 7888, to solve these sync issues that will prevent profile information inside the content databases to be updated you can follow these steps.
First we want to find all databases that are not synced up correctly, to do this we use the command:
stsadm -o sync -listolddatabases <number>
This will give you a list of database GUID’s and the date/time they were last synchronized. We need the GUID’s to get the databases in sync again. The following command will change all GUID’s in the database as old and the next time the indexer runs it will generate new GUID’s for that content database.
stsadm -o preparetomove -contentdb <databse server name>:<content database name> -oldcontentdb <GUID>
where <GUID> is a guid from the content database in the list generated with the listolddatabases command above. Repeat this for every database in the list you want to ‘recover’
Once your next full crawl completes you can run the stsadm -o sync -listolddatabases <number> command again. And anything still on the list can likely be removed at this point. You can remove these by running the following command.
stsadm -o sync -deleteolddatabases <number>
This will delete all GUID entries in the SSP for anything that is out of sync for more than <number> of days. After running these commands all events in the eventlog should stop to appear in the eventlog.
You can test this by decreasing the sync timing job to 5 minutes and check the eventlog to see if these events are gone, you can do this by running the following command.
stsadm -o sync -synctiming “m:5”
Then reset the sync timing back to default value of 1 hour by running the following command.
stsadm -o sync -synctiming “h:1”
This procedure will solve your out of sync issues you may have in your farm and will ensure that the relation between content database and SSP is optimal. This also means profile information residing inside the content database will be updated again and the crawl should show less errors as well. As i have stated in the previous post you can prevent this problem by using stsadm -o preparetomove before detaching a database.