/ Development  

Disastrous attempt; The pitfalls of syncing solutions between organizations

Hi there AppWorks fans,

Welcome to a new installment of AppWorks tips.

A while ago, I provided an AppWorks training in the Netherlands where people flawlessly gained their certification! The training itself is not the point for this post, but providing a training pushes you back into reality where a simple task can have a significant impact. After a while (and gaining experience), you do things without thinking (like driving a car); For others, the simple things can be a challenging task. One of these things is the reconstruction of a copied source project; Because you got it from someone, or because your workspace wasn’t connected to a source control system (like SVN or Git), or you simply want to switch the sources from one organization to another (where you start with fresh input!). All valid scenarios where one action is a key player to understand…

Reach out to me if you also would like to get a workshop from the best in the battlefield. I’m not restricted to a static PowerPoint force with strict assignments. We step off the grid, dive into the deep, and experience the platform beyond “the default”. Online, offline, 1-hour, 1-day, 5-days…You name it; Tell me your weakness and I’ll bring you a tailor-made offer to boost your weakness into expertise.


Let get right into it…

Boot up that VM of yours and jump into your favorite spot of the platform. Here we open our artifact ‘Workspace Documents’, we use our current workspace (of create a new one), and we open the related project (in my case two projects!). I already have some documents available which you can create on your own…Keep it simple as we don’t do anything with them, but always make sure they are publishable (I don’t think it’s a requirement, but that’s just a gut feeling from my side).

sync_001

With your project open, it is time to trigger a synchronization option from the context menu:

sync_002

Hit it and wait for the magic execution…You need to do this for each project separately (or hit the “Synchronize All” in the top bar!)

From the Workspace properties there is another option available to trigger this sync automatically:

sync_003

To be honest…I never used it at any project; I only do it manually, as it’s not a common task.

Now what? Well, what about having a look at the AppWorks server:
/opt/opentext/AppWorksPlatformCE/defaultInst/cws/sync/appworks_tips/ws_aw_tips/...

sync_004

How nice! AND this is how the path structure looks like ./cws/sync/{org_name}/{workspace_name}/{project_name}

So, when we create a new organization, with a new workspace, with an empty “dummy” project, do a sync, copy the above into it the folder (server-side), and resync. Will we have our projects back in the new organization!?

SPOILER ALERT…Yes, we will!


In practice

Jump into the shared/system organization with the ‘sysadmin’ account and create a second organization with the ‘Organization Manager’ artifact. Could be you need to ask your administrator to accomplish this task:

sync_005

I always use a second “incognito” tab in Chrome for that second session with a different account; This makes it easier to switch between accounts.

Now, switch to the new organization (with your developer account) and create a new workspace with the regular wizard on start of the ‘Workspace Documents’ artifact.

sync_006

In the new organization you need to make sure your account has the ‘Developer’ role applied again!

sync_007

Follow the workspace creation wizard till you have a new one including a new “dummy” project which you can synchronize again:

sync_008

With this sync for the new project, you have a new folder structure available on the server:

/opt/opentext/AppWorksPlatformCE/defaultInst/cws/sync/appworks_tips_build/ws_aw_tips_demo/...

Right…It’s time to copy our “backup” into this new structure (with some permission restructuring):

1
2
3
sudo cp -R /opt/opentext/AppWorksPlatformCE/defaultInst/cws/sync/appworks_tips/ws_aw_tips/* /opt/opentext/AppWorksPlatformCE/defaultInst/cws/sync/appworks_tips_build/ws_aw_tips_demo/
sudo chown tomcat:tomcat -R /opt/opentext/AppWorksPlatformCE/defaultInst/cws/sync/appworks_tips_build/ws_aw_tips_demo
sudo chmod 775 -R /opt/opentext/AppWorksPlatformCE/defaultInst/cws/sync/appworks_tips_build/ws_aw_tips_demo

After this, you can do a sync again via ‘Synchronize All’:

sync_009

Watch what happens after…

sync_010

It’s a party! 🎉🎊 The final thing is now deleting the dummy project and continue life…A task on your own!


Q/A time

  • Does this whole trick also work across servers? Off-course…You only need to copy your sync folder to the other server! So, when I share a project, this is also your entry to synchronize it into your AppWorks organization!
  • How does this trick work with an attached source control system? A valid question where you don’t need a sync action; Simply create a new workspace (in the new organization) and re-attach it to the same source control URL! This reconstructs the project from your central sources.
  • Can we (via this post) attach a source control afterward? A great question with a simple answer…YES, you can! Connect the SCM (SVN/Git) to that new workspace, also create the dummy project, sync, copy, resync, remove the dummy, and do your commit! 😎

A synchronized “DONE” where we learned the power synchronized an AppWorks project from one location to another location! A simple task for the trainer, but a challenge for the trainee (that’s at least what I experienced during a great given training course). Things are clarified now with exposed tricks beyond your thinking process. Have a great weekend and I see you in another great trick at AppWorks Tips.

Don’t forget to subscribe to get updates on the activities happening on this site. Have you noticed the quiz where you find out if you are also “The AppWorks guy”?