Recover Joget App From Local GIT

To recover a Joget app from a local Git repository, following these steps ensure you synchronize the app's versions correctly and recover any missing configurations:

  1. Preparing the Files from Backup, assume you have backup folders for your app versions:

    wflow/app_src/supportTicket/supportTicket_1
    wflow/app_src/supportTicket/supportTicket_2
    wflow/app_src/supportTicket/supportTicket_3
    In each version folder (supportTicket_1, supportTicket_2, supportTicket_3), ensure they are structured with the subsequent versions as branches (e.g., supportTicket_1 contains supportTicket_2 as a branch).

    Example: 
    You can see that folder version 1 contains version 2 when executing git branch command.
    C:\Joget-DX8-Enterprise\wflow\app_src\supportTicket\supportTicket_1>git branch
      help
      master
    * supportTicket_1
      supportTicket_2
    In supportTicket_2, it does not contain version 3 somehow. 
    C:\Joget-DX8-Enterprise\wflow\app_src\supportTicket\supportTicket_2>git branch
      master
    * supportTicket_2

    You can run git branch supportTicket_3 to create the branch.

    C:\Joget-DX8-Enterprise\wflow\app_src\supportTicket\supportTicket_2>git branch supportTicket_3
     
    C:\Joget-DX8-Enterprise\wflow\app_src\supportTicket\supportTicket_2>git branch
      master
    * supportTicket_2
      supportTicket_3
    Copy these folders into your Joget working directory (wflow/app_src/supportTicket/).
    Omit wflow/app_src/supportTicket/app.properties from the backup to prevent potential conflicts, such as with the existing remote GIT server.
  2. In Joget, create a new app with the matching app ID supportTicket". Initially, you'll start with version 1, which will be empty.
  3. Go to Settings > Git Configurations in Joget. Check Auto Sync DB From Git to enable automatic synchronization.
  4. Click Builders to refresh the page. This action triggers Joget to initiate the GIT Sync process.
    • Joget will sync from the local Git repository into the Joget database for app version 1.
    • This sync includes forms, lists, UIs, and processes defined in your Git repository.
  5. After the initial sync, click the Version.
    • You should see the next version available (version 2). Select it and click "View".
    • This action triggers Joget to perform another sync from Git for version 2.
    • Remember, each version folder (supportTicket_1, supportTicket_2, etc.) in your Git backup must correspond to the subsequent version as a branch.
    • Use the command git branch appId_n+1 in each version folder to create the necessary branches (supportTicket_2, supportTicket_3, etc.).
  6. Repeat step 5 for each subsequent version until all versions are synced up in Joget.

This ensures all historical versions of your app are recovered and accessible within Joget.

Recover Missing Plugins, Process Mappings, Resources and Messages

In some cases, you may realize that previously configured process mappings (participant, activity, tool, decision), resources (files uploaded), and messages (translations) may have gone missing. This is because, in step 2 earlier, when creating a new Joget app, when Joget attempts to initialize a new GIT folder, it creates a clean slate and then attempts to merge the clean slate with the backup copy in step 5. During the merging process, it might have overwritten the content of these files:-

  • appDefinition.xml
  • appConfig.xml

To recover to the intended state, you must revert the changes made via GIT.

You must do it for each app version you wish to recover. In this example, we will focus on the latest version 3.

  1. Shut down the Joget server so it does not lock onto the GIT folder.
  2. Use your favorite GIT interface and find out at which commit changes are made to remove the content in the 2 files mentioned above. For example, we found out that it happened in commit e87ec85.
  3. Make use of GIT and perform a GIT reset.
    C:\Joget-DX8-Enterprise\wflow\app_src\supportTicket\supportTicket_3>git reset e87ec85
    Unstaged changes after reset:
    M   appConfig.xml
    M   appDefinition.xml
    C:\Joget-DX8-Enterprise\wflow\app_src\supportTicket\supportTicket_3>git status
    On branch supportTicket_3
    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git checkout -- <file>..." to discard changes in working directory)
     
        modified:   appConfig.xml
        modified:   appDefinition.xml
    If you are using Github Desktop, you can right-click on e87ec85 and choose Revert Changes in Commit.
  4. Verify the changes, resolve the conflicts, and commit the unstaged files if necessary. Using GitHub Desktop, you can inspect the changes in the Changes tab, resolve the disputes if required, and commit the unstaged files.
  5. Start the Joget server, go to the app, and trigger a sync from GIT to Joget.

See Recover Joget App From Remote GIT for additional information.

Created by Julieth Last modified by Aadrian on Dec 13, 2024