Why teams sync XWiki pages to a GitLab repository
Many teams keep procedures, architecture notes and runbooks in XWiki, yet they want those documents versioned, reviewed and traced the way code is. The xwiki-contrib GitLab application commits XWiki pages to a GitLab repository, supports XWiki 8.4 and later and is licensed under LGPL 2.1. For a team that already reviews changes in merge requests, this puts wiki content into the same review path as the software it describes, with each change recorded as a commit that someone can later inspect or revert.
The sync is a publishing bridge, not a replacement for the wiki. XWiki stays the place where people author and browse pages, and the repository holds a copy that tools and reviewers can work with. Before any design work, confirm in the extension documentation which direction the sync runs, whether it is one way or two way, when commits are created, how page hierarchy and attachments are represented, and what file format the pages are written in. Those answers decide whether a repository edit can ever flow back into XWiki, and whether the repository can serve as a source of truth at all.
Plan for the points where the two systems disagree. Page edits made in XWiki and in Git can collide, deleted pages need a rule for what happens in the repository, and access in GitLab may differ from the rights defined in XWiki. Decide early who owns the sync account, which GitLab project and branch receive commits, and who approves merge requests that touch documentation. Ask the extension maintainers or your own test instance to show these cases before you commit to a workflow.
What you need before you connect XWiki to GitLab
The GitLab sync depends on four parties agreeing on versions, identity and network paths before any page is committed. Confirm the XWiki line, the GitLab tier and edition, the service identity and the trust chain first, because each one changes the others during testing.
XWiki version line
The xwiki-contrib GitLab Application supports XWiki 8.4 and later, so the floor is not the constraint. Choose between the stable line, tagged 18.8.0, the LTS line, tagged 17.10.14, and the intermediate LTS, tagged 18.4.7. Pick the line you can keep patched, then confirm that the application version you install is supported on that exact release before you build against it.
Application repositorySelf-managed GitLab edition and tier
The sync needs a self-managed GitLab instance you operate. GitLab Free, Premium and Ultimate all apply to self-managed installs, so the tier is a feature decision, not an installation prerequisite. Confirm with GitLab which tier includes the merge request approval rules and protected branch controls you plan to rely on, and record that answer in the scope.
GitLab pricingScoped service account and token
Create a dedicated GitLab user for the sync rather than reusing a personal account, so commits are attributable and the account can be disabled without affecting people. Grant it write access only to the target project, and issue a personal or project access token limited to the API scope needed for committing. Document who owns the token, where it is stored in XWiki, and when it rotates.
Outbound network path from XWiki
The XWiki host must reach the GitLab HTTPS endpoint directly or through an approved proxy. Check firewall rules, DNS resolution from the Tomcat container, and any egress allow-list in the data center or cloud account. Test from the same network segment that runs XWiki, because a path that works from a laptop often fails from a restricted subnet.
Internal CA certificates
If GitLab uses a certificate signed by an internal certificate authority, the Java trust store used by XWiki's Tomcat must include that CA chain. Otherwise the connection fails during the first commit with a trust error. Obtain the full chain from your PKI team, import it into the runtime trust store, and plan how the import survives container image updates.
Review and branch protection requirements
Write down whether pages must pass through merge requests before reaching the default branch, and whether protected branches or required approvals are mandatory. These controls determine the GitLab tier, the branch layout and whether XWiki writes directly to main or to a working branch. Agree the review owner for each space before the first sync.
How XWiki, the sync application and GitLab fit together
The diagram starts with an editor saving a page in XWiki, where the GitLab application is installed on the wiki host. The application commits the page content to a branch of a GitLab project, using a service account token rather than an editor's own credentials. Changes then reach the main branch only through a merge request that a reviewer approves. Check that the token is scoped to the one project, that the reviewer role is separate from the service account, and that the wiki host and GitLab sit on opposite sides of the trust boundary.
Page commits flow from the wiki host to a GitLab branch, then through review.
How the sync moves pages between the wiki and the repository
The design question for this section is what causes a commit, because that decides how often repository history changes and who sees it. The xwiki-contrib GitLab Application connects an XWiki instance to a GitLab project so that wiki page content can be committed to the repository. Before you design around it, confirm in the extension's own documentation which actions in XWiki trigger a commit, such as saving a page, publishing a change or a manual export, and whether a save that is still a draft produces a commit. Most teams find that an event-driven trigger creates many small commits from active editors, while a manual or batched trigger gives reviewers fewer, larger changes. Write down the trigger you expect, then test it on a copy of your wiki with a few pages edited in sequence.
Next, confirm how page content is written to files. The key details are the file format used for each page, the folder layout that mirrors the wiki space hierarchy, how attachments and page metadata such as the author and title are stored, and whether XWiki syntax is preserved as written or converted. Page history is the other mapping to check. Ask whether each wiki version becomes one commit, whether the wiki author becomes the commit author in GitLab, and what happens to versions made before the sync was enabled. These answers determine whether the repository can serve as a reliable audit trail, and they also determine how much of the history a reviewer can see in a merge request.
Finally, confirm the direction and branch behavior, since they shape the operating model. Check whether the sync is one-way (wiki to repository) or bidirectional, because a bidirectional sync needs conflict rules for pages edited in both places. Check whether commits land on the default branch or on a feature branch that someone must merge, and whether the extension can be pointed at a protected branch. Also confirm how deleted and renamed pages are handled: a rename can appear as a delete and a create, which breaks file history unless the extension tracks it. Record the answers as acceptance tests before go-live.
Configuring the sync in the order that avoids rework
This sequence confirms the XWiki version and application source first, then sets up the GitLab side with narrow access, so the sync is only pointed at a target once each dependency has been checked. The result is a verified test commit that shows the path and author you expect before any real space is connected.
Confirm the XWiki version against the minimum
The XWiki administrator checks the running XWiki version before anything else is installed. The xwiki-contrib GitLab Application supports XWiki 8.4 and later, so an instance older than 8.4 needs an upgrade before the sync can be configured. Confirm the exact version in the administration pages and record it in the change ticket. The step is done when the version is written down and confirmed at or above 8.4.
Install the application from the xwiki-contrib source
An XWiki administrator installs the GitLab Application from the xwiki-contrib source repository, not from an unverified copy. Confirm that the application's license (LGPL 2.1) and the release you install are acceptable to your change process. Install it on a non-production instance first if you have one. The step is done when the application appears in the extension list of the test instance and its version matches the one you recorded.
Create a dedicated GitLab project and service account
A GitLab administrator creates a dedicated project for wiki content and a separate service account that owns the sync. Grant the service account the narrowest token scope the application documents, and confirm the documented scopes in the application README before issuing the token. Do not reuse a personal account or an administrator token. The step is done when the service account is a member of the project with the minimum role needed to commit, and the token is stored in your secrets manager.
Set the target branch and repository path
The XWiki administrator sets the target branch and the repository path that the application writes to. Use a branch that is not your default branch if merge requests will review wiki changes, and choose a path structure that mirrors your space hierarchy so files are easy to find later. Confirm the exact configuration keys in the application documentation. The step is done when the settings are saved and reviewed by a second person against your naming standard.
Run a test commit against a sample space
Create a small sample space in XWiki with two or three pages, including one page with attachments, and run the sync against it. Use a test space that holds no sensitive content, because the test is also a check that content leaves only where you intend. Trigger the commit through the application's normal action rather than by editing GitLab directly. The step is done when the sync reports success in XWiki and no error appears in the instance logs.
Verify the commit in GitLab
Open the target project in GitLab and inspect the commit that the sync created. Confirm it appears on the target branch, that files sit under the expected repository path, and that the author shown is the service account you created. Compare the page content with the XWiki source to catch missing or altered text. The step is done when the path, branch, author and content all match what you configured, and the result is recorded before any production space is connected.
How wiki spaces, pages and metadata map to repository files
This table compares each wiki element with its likely repository counterpart and marks whether the mapping is documented, must be confirmed in the application README, or is a design decision your team makes before the first sync. Read the design decision rows first, because they shape file names, folder layout and history that are hard to change after pages are committed.
| Wiki element | Repository mapping | Status and what to confirm |
|---|---|---|
| Spaces and nested pages | Directories that mirror the space hierarchy, with one folder per space | To be confirmed in the application README: whether nested child pages become subdirectories or sibling files |
| Page titles | File names derived from page titles | Design decision: naming rules for titles with spaces, slashes, accents or characters GitLab or the file system restricts |
| Page content format | Files in the syntax the application writes, committed as text | To be confirmed in the application README: the exact syntax and file extension written for each page |
| Page authors and timestamps | Commit author and commit date for each saved revision | To be confirmed: whether the application maps XWiki users to Git identities and how users without a matching email are recorded |
| Page history | One commit per wiki revision or one commit per sync run | Design decision: whether reviewers need every revision or a batched commit per sync, which changes history size and merge request noise |
| Attachments | Files stored at paths beside their page, or excluded from sync | Design decision: large binaries in Git increase repository size, so decide whether to store them, use Git LFS or exclude them |
| Deleted and renamed pages | Removed or moved files in the next commit | To be confirmed: how renames appear in Git history and whether deletions are propagated automatically |
| Access permissions | Repository access controls, not wiki rights, govern who sees the files | Design decision: pages restricted in XWiki may be readable in GitLab, so align repository visibility with wiki rights before syncing |
Securing the link between the wiki and the repository
Anyone who can edit a synced XWiki space can change content in the GitLab repository, so the wiki space permissions and the repository permissions have to be designed together. The cards below cover the credentials, branch rules, roles, secret storage, transport and instance hardening that connect the two systems.
Service account and token scope
Create a dedicated GitLab service account for the sync rather than reusing a personal account. Give its access token only the repository scope it needs, on the projects it needs, and set an expiry date that your team renews on a schedule. Confirm with the xwiki-contrib GitLab application documentation which token type and scopes it expects, because a token broader than that is a larger blast radius if the wiki is compromised. Record who owns the account and who rotates the token.
Branch protection on the target branch
Protect the branch that receives wiki commits so that nothing lands directly without a merge request. Prevent force pushes and deletion on that branch, and require the sync to push to a working branch that feeds a merge request. Test the rule with the service account itself, since a rule that blocks humans but leaves the sync account with direct push rights defeats the review step.
Restricted roles for approvers
Limit who can approve merge requests that carry wiki content to a named group, separate from the people who edit pages in XWiki. Keep the approver role distinct from maintainer rights so no single person can both approve and merge changes to the protected branch. Review group membership on the same cadence as wiki space rights, because a stale approver list quietly removes the control.
Secrets kept out of wiki pages
Store the GitLab token and any repository connection settings in the platform's secret or configuration store, never in a wiki page, a macro parameter or a page attachment. Any XWiki user with edit rights on a page can read its source, so a token written there is exposed to every editor and to the page history. Check that the page history and any exports do not contain the credential after a test run.
TLS on every connection
Serve the XWiki instance and the GitLab instance over HTTPS, and confirm that the sync connection uses a verified certificate chain rather than disabling verification for an internal certificate authority. Check each hop: browser to XWiki, XWiki to GitLab and any reverse proxy in between. Plaintext on any one hop exposes the access token, which grants repository write access.
GitLab hardening for self-managed instances
Apply the GitLab hardening recommendations to the self-managed instance that hosts the repository, including sign-in and authentication settings, administrator access and network exposure. Confirm that the instance is also covered by your backup and restore plan, since a restored repository without its branch rules and tokens may behave differently. Ask your team to review these settings once before go-live and again after each GitLab upgrade.
GitLab hardening docsHow to test the sync before teams depend on it
Run a scripted test against a sample space before any team relies on the sync. The sample space should exercise every case the sync must handle: a parent page with nested child pages, an edit to a child, a deletion, a rename that changes the page path, an attachment upload, and a change to the permissions of one page. After each step, record what the xwiki-contrib GitLab application committed. Check the repository for the expected file paths, the commit messages and the author identity, and confirm that a deleted page is handled the way your team has decided it should be, whether that means a removed file or a retained one. Confirm also how attachments are stored and whether a permission change produces any commit at all, since that behavior determines whether restricted content can reach a repository with broader access.
Then test the review path, which is the reason most teams choose this pattern. Push the sync output to a branch or a project set up for it, open a merge request, and have a reviewer who did not make the edits check the diff. Confirm that the diff is readable for prose, that attachments appear as binary changes the reviewer can actually inspect, and that the protected branch and approval rules in your GitLab instance block a direct push to the default branch. The GitLab authentication and authorization documentation covers the roles and project settings to verify. Treat any surprise in this step as a design question to resolve before rollout.
Finish with a restore drill. Take a GitLab backup using the GitLab backup and restore documentation, restore it into a separate environment, and confirm that the synced project, its merge requests and its history are present. Back up the XWiki instance as well, restore it, and confirm that the sync can resume without duplicating commits. Record the XWiki and GitLab versions used in the test, the extension version, and the commands and settings used, so the same test can be rerun after each upgrade. Confirm the exact GitLab version support and any upgrade stop requirements with your own instance before you plan that retest.
Common sync failures and how to fix them
This table lists the sync failures most likely to stop XWiki pages reaching a GitLab repository, with the probable cause, the check to run and the fix for each. Work down the rows in order, since token and network problems hide every other symptom. Items marked as needing confirmation depend on the exact XWiki extension and GitLab version in your environment, so verify them against those documentation sets before changing production settings.
| Failure | Probable cause and check | Fix and what to confirm |
|---|---|---|
| Token rejected or missing scope | The access token has expired, was revoked, or lacks the write scope needed to push commits. Check the token's status and scopes in GitLab and the credential stored in the XWiki application configuration. | Issue a new token for a dedicated service account with only the scopes needed for commits. Confirm the required scopes in the xwiki-contrib application documentation and the GitLab authentication guide. |
| Protected branch rejects the service account | The target branch has protection rules that block direct pushes or require merge requests for the account used. Check the branch protection settings and the account's role on the project. | Grant the service account push permission on a dedicated sync branch, or route commits through merge requests. Confirm the exact role and protection options in GitLab's project settings documentation. |
| Network or certificate failure | XWiki cannot reach the GitLab host, or the TLS certificate is untrusted by the XWiki Java runtime, often because it is issued by an internal certificate authority. Check connectivity from the XWiki container or server and inspect the error in the XWiki logs. | Add the internal CA to the Java truststore used by Tomcat, open the required outbound route or proxy setting, and retest the connection. Confirm the truststore steps against your XWiki deployment and Java version. |
| XWiki version below 8.4 | The xwiki-contrib GitLab Application supports XWiki 8.4 and later. An older instance may fail to load the extension or show missing functions. Check the installed XWiki version in the administration area. | Upgrade XWiki to a supported line before installing the application. Plan the upgrade with the XWiki upgrade documentation, since the current supported lines are far newer than 8.4. |
| Duplicate or invalid file names | Two pages map to the same file path after conversion, or page titles contain characters the repository path does not accept. Check the sync log for path or conflict errors and list the affected page names. | Define a naming rule that maps each page reference to a unique path, rename offending pages in XWiki, and rerun the sync. Confirm which characters the extension escapes or rejects in its own documentation. |
| Large attachments fail or bloat the repository | Attachments above a size the GitLab instance or proxy accepts are rejected, and large binary files grow repository history. Check the GitLab maximum file and push size settings and the sizes of the synced attachments. | Decide which attachment types sync, exclude large binaries, or store them in an artifact or object store and link to them. Confirm the GitLab size limits for your installation with your administrator. |
| Merge requests pile up without review | Changes are pushed to a review branch, but no named reviewer or owner handles them, so open requests age and new edits conflict. Check the open merge request count and the age of the oldest one. | Assign a documentation owner and reviewer group, set a review rule and a cleanup schedule for stale branches, and agree who resolves conflicts before the sync runs again. |
| Sync reports success but content is stale | The sync job runs on a schedule or trigger that is no longer firing, or it authenticates as a user without read access to the latest pages. Check the job history and the last commit time in the repository. | Confirm the trigger, restore the schedule, and test with one edited page. Verify the scheduling mechanism in the extension documentation before relying on it for records. |
Questions buyers ask before syncing wiki content to GitLab
What does it cost to sync XWiki pages to GitLab?
The cost is mostly the people doing the work plus the infrastructure both platforms run on. XWiki and GitLab are both open source and self-hosted in your environment, so there is no license fee for the core software, but you pay for servers or cloud capacity, backups, and the labor to configure and maintain them. If you choose GitLab Premium for advanced CI/CD and priority support, the GitLab pricing page lists it at 29 US dollars per user per month billed annually. Ask any partner for a fixed-scope quote that separates one-time setup from recurring upkeep, and that states how many spaces and pages are in scope.
What drives the cost of a GitLab wiki sync up or down?
Four factors move the cost most. The first is the number of XWiki spaces and pages in scope, since mapping spaces to repository folders and checking the converted content takes longer as volume grows. The second is the GitLab tier and how many users need merge request access, which affects licensing spend. The third is hosting: a single-node installation costs less to run than a high availability setup, which GitLab generally recommends for 3,000 or more users. The fourth is how much review workflow you want, such as approval rules, branch protection and CI checks on wiki content.
How long does it take to set up a wiki to GitLab sync?
Duration depends on scope, not on the tool itself. A small wiki with a few spaces, one repository and a single review group is a short project, while a large instance with many spaces, mixed permissions and an existing GitLab that needs hardening takes longer. Time is spent on four things: agreeing the folder mapping, testing the commit behavior on a copy of real content, setting up the reviewer workflow in GitLab, and running a review of the first committed pages. Ask for a written timeline tied to the agreed scope before work starts.
What does our internal team need to provide for the sync?
The project goes faster when your team supplies four things before work starts. You need wiki administrator access to the XWiki instance so the application can be installed and configured, and GitLab administrator access to create the target projects, tokens and group settings. You also need a named reviewer group that will approve changes to wiki content in merge requests. Finally, you need a decision on content format: whether pages are stored as XWiki syntax, converted to Markdown, or kept in another form, because that choice affects how readers and reviewers work with the files.
Can our in-house team set up XWiki to GitLab syncing without outside help?
Yes, a team with experience running XWiki and GitLab can do it, because the xwiki-contrib GitLab Application is open source under LGPL 2.1 and supports XWiki 8.4 and later. The harder part is the design work: deciding what gets committed, how permissions map to repository access, and how conflicts are handled when a page is edited in both places. Teams without that experience often benefit from a fixed-scope review of the design before building. DeployOpen plans, implements and documents this kind of integration in your infrastructure, so you can compare that scope against your own capacity.
How do XWiki and GitLab upgrades affect the sync?
Both sides change over time, so the sync needs planned upkeep. GitLab ships a major release yearly, a minor release on the third Thursday of each month and patch releases twice a month, and it requires upgrades to pass through required upgrade stops. Since GitLab 17.5 these fall at versions x.2, x.5, x.8 and x.11, for example 18.2, 18.5, 18.8, 18.11, 19.2, 19.5, 19.8 and 19.11. Each XWiki upgrade must also be tested against the GitLab Application. Plan a test instance, a change window and a rollback path for both platforms.
What should we check before relying on GitLab for wiki history?
Confirm that the sync keeps what your auditors and readers need before you depend on it. Check how page history maps to commits, how deleted pages are handled, and who can push or force-push to protected branches. Test restoring a repository from a GitLab backup, since GitLab documents backup and restore procedures that should be rehearsed with your own data. Also confirm that the sync does not become the only copy of content, and record which system is authoritative for each space. Ask the partner to show these checks in the written scope.
How DeployOpen scopes, delivers and supports the GitLab sync
DeployOpen plans, builds, documents and supports self-hosted open-source platforms inside your own infrastructure, and this sync is handled the same way. We agree the scope in writing first, then build and test the XWiki to GitLab commit path in your environment before handing it over.
How we scope
- Confirm the XWiki version line and the xwiki-contrib GitLab application version your instance can run, since the application supports XWiki 8.4 and later.
- Agree which spaces, page trees and attachments are committed, and the repository layout, branch and merge request rules that will govern them.
- Record in the written scope who owns the GitLab project, the service account used for commits and the review approvers for merge requests.
How we build
- Install and configure the GitLab application against a test wiki and a test GitLab project before any production content is connected.
- Test page creation, edits, deletions and renames, checking that commits, author attribution and file paths match what the team expects.
- Confirm the GitLab deployment is reachable from the XWiki server over the network path you approve, including any air-gapped or internal certificate setup.
How we hand over
- Deliver written runbooks covering the sync configuration, service account credentials handling, token rotation and how to add or retire synced spaces.
- Document the test results, known limits of the sync and the steps to restore a repository from a backup if content is lost or overwritten.
- Walk your wiki administrators and GitLab maintainers through the merge request workflow so they can review and approve wiki changes independently.
How we support
- Engagements are fixed-scope, so scope, deliverables and timelines are agreed in writing before the work starts.
- Ongoing support, upgrades and continuous testing are available as a retainer, which can cover XWiki and GitLab version changes that affect the sync.
- Ask for a written quote that lists the XWiki, GitLab and application versions in scope, the environments tested and the retest steps after each upgrade.

