Synchronize remote application data with the Communities database
If we identify data inconsistencies between communities and their remote applications, to synchronize remote applications with the current state of communities, run...
CommunitiesRemoteAppService.resyncRemoteAppsForCommunity
Be sure that all remote applications are running and the widget lifecycle retry queue is empty.
We can synchronize the following types of information from the community to the remote applications:
- Visibility changes, for example if a community's visibility is changed from Restricted to Public.
- Theme changes, for example if a community's theme is changed from blue to silver.
- Moderation changes. If Connections Moderation is enabled in your environment (applies only to Files, Forums, and Blogs), these commands synchronize changes that are made to the Moderation check boxes. These check boxes display in the Edit Community page and are :
- Owners must approve all content
- Viewers can flag inappropriate content
There are four commands for synchronizing remote application data with the Communities database:
- CommunitiesRemoteAppService.resyncRemoteAppsForCommunity("communityUuid") synchronizes all remote applications associated with the single community specified by the UUID in the command.
- CommunitiesRemoteAppService.resyncRemoteAppsForCommunityAndWidget("communityUuid", "widgetDefId") synchronizes the specified remote application associated with the single community specified in the command.
- CommunitiesRemoteAppService.resyncRemoteAppsForAllCommunities("widgetDefId") synchronizes the specified remote application for all communities.
- CommunitiesRemoteAppService.restartResyncRemoteAppsForAllCommunities("lastCommunityUuid", "widgetDefId") restarts the synchronization if a network or server outage causes resyncRemoteAppsForAllCommunities() to fail.
These commands can result in a loss of data if misused. Therefore, use these commands under the following circumstances only:
- A remote application database is restored from backup and some Communities data is lost.
- A remote application is not synchronized with Communities data because of a software defect.
- Start the Communities Jython script interpreter
cd app_server_root/profiles/Dmgr01/bin
./wsadmin.sh -lang jython
execfile("communitiesAdmin.py")
- Enter the following command to synchronize remote applications with a single community:
CommunitiesRemoteAppService.resyncRemoteAppsForCommunity("communityUuid")
We can obtain the UUID for a community or subcommunity by doing one of the following actions:
- Use a browser, open the community or subcommunity you want and copy the UUID from the URL.
- Run the CommunitiesService.fetchAllComm() wsadmin command to fetch all communities and subcommunities on the server. Copy the UUID from the output.
For example:
CommunitiesRemoteAppService.resyncRemoteAppsForCommunity("59d8e5a7-ba0e-488f-8bcd-1f79a994e419")
If the community with UUID: 59d8e5a7-ba0e-488f-8bcd-1f79a994e419, contains the Activities, Status Update and Files widgets, the command resynchronizes communities data to these three remote applications.
- Enter the following command to synchronize remote applications with a single community and widget: CommunitiesRemoteAppService.resyncRemoteAppsForCommunityAndWidget("communityUuid","widgetDefId") Valid input values for widgetDefId are :
- Activities
- Blog
- IdeationBlog
- Files
- Forum
- Library
- StatusUpdates
- Wiki
widgetDefId values are case-sensitive, we must enter these values as shown. For example:
CommunitiesRemoteAppService.resyncRemoteAppsForCommunityAndWidget("c0281270-44a9-4be0-a9d6-db64f63d", "Forum")
One widget (Forum) in one community is resynchronized.
- Enter the following command to synchronize remote applications with all communities:
CommunitiesRemoteAppService.resyncRemoteAppsForAllCommunities("widgetDefId")
The command outputs the UUID of the last community it synchronized, and updates every 10 communities. It ends with "Done"when all communities are resynchronized on the server.
Here is a sample of the type of response you receive when we synchronize a remote wiki with all communities:
wsadmin>CommunitiesRemoteAppService.resyncRemoteAppsForAllCommunities("Wiki") Total Processed: 10 Last processed communityUuid: 048d011f-e2c1-4d11-975e-b3afb474c8db Total Processed: 20 Last processed communityUuid: 0af8a947-7de9-424f-9f88-c984ebe169f7 . . . Total Processed: 270 Last processed communityUuid: 554d79ae-0e81-4f54-a4b8-6a2c4497ba5c Done.
- If a network or server outage causes resyncRemoteAppsForAllCommunities() to fail to restart the synchronization beginning where the last synchronization step failed. CommunitiesRemoteAppService.restartResyncRemoteAppsForAllCommunities("lastCommunityUuid", "widgetDefId")
For example:
CommunitiesRemoteAppService.restartResyncRemoteAppsForAllCommunities("44f52a77-bccd-433c-bdf9-2d19f42d944b", "Wiki")
Parent topic:
Recover from a database failure
Related:
Related:
Recovering remote Connections applications
Related reference: