Admin Tools Application

The Admin Tools application is a collection of scripts that wiki administrators can execute to:

  • list the system configuration information
  • perform various database maintenance tasks
  • display the rights configuration and so on

As the application is not bundled with XWiki Standard, it is recommended to install it using the Extension Manager. You can later access it by clicking on "Admin Tools" in the "Applications" panel on the left - in case you cannot find it there, you can easily pin it as explained in the Applications Panel documentation.


The application home page displays links to dedicated scripts grouped by category.

Configuration Tools


This section has 2 scripts - one of them is "XWiki Configuration Check" (functional only on Linux environments) which displays:

  • the memory settings of the Java Virtual Machine including:
    • Max Memory - corresponds to the Java "Xmx" parameter
    • the amount on used memory
    • the amount of free memory
  • caching details like:
    • Store Page Cache Capacity - retrieves the value of the parameter set in the file xwiki.cfg  
    • Store Page Cache in Use
  • database configuration details:
    • Max Active - the number of possible connections to the database
    • Max Idle - the number of possible idle connections to the database
    • Active - the currently active connections to the database
    • Idle - the current idle connections to the database
  • encoding configuration for Tomcat, the XWiki instance and Java - in all 3 cases, the returned value should be UTF-8

The second script, "Programming Rights Check" saves XWiki pages from the entire farm with programming rights. Documents requiring programming rights have an attached "XWiki.RequiredRightClass" object set to "programming".


In order for the script to execute correctly, you need to have programming rights. For more details, please refer to the Rights Overview page.

Activity Tools

The "Activity Tools" section has 3 scripts:

  • Show Logs is for the moment only functional on Linux environments and displays the last 2000 lines of the "/usr/local/tomcat/logs/catalina.out" log file


  • Show Rights is a tool for displaying the rights overview for the wiki users and groups and it can be efficient to detect redundancies and inconsistencies:
    • the "Global" section displays privileges at wiki level
    • the "Spaces" section lists users and groups rights settings at space level
    • the "Pages" section lists users and groups rights at page level


  • Flush XWiki Cache - is a script for flushing the wiki cache which is useful when you add new JavaScript or CSS / LESS CSS functionality and you want to ensure the result is the correct one.

Storage Management Tools

  • Space Used displays the amount of space in Megabytes used by some of the largest XWiki database tables:
    • xwikirecyclebin - stores deleted documents
    • xwikircs - stores document versions
    • xwikiattachment_content - stores the content of attachments
    • xwikiattachment_archive - stores attachments versions
    • xwikiattrecyclebin - stores deleted attachments

It is recommended to run this script in case you are running out of database space, in order to know which tables should be flushed. Normally, you would want to delete xwikirecyclebin, xwikiattachment_archive and xwikiattrecyclebin.

If you are storing attachments on the file system instead of the database, the script won't display anything for the last 3 tables.
  • Shrink Recycle Bins allows to quickly flush your wikis' documents and attachments recycle bins, more exactly the tables xwikirecyclebin and xwikiattrecyclebin respectively.


If you are storing attachments on the file system instead of the database, the script won't be able to flush the attachments recycle bin.
  • Database to FileSystem Porter helps you migrate attachments from the database to the file system, for the case when you have enabled the file system storage. For more details, please refer to the dedicated documentation.

Upgrade Tools

If you have a heavily customized wiki and you plan to upgrade, you can use the "Wiki Diff" tool to compare your current wiki with the standard distribution. This way, you will know what to expect when upgrading with the Distribution Wizard. The script should automatically detect your distribution and fill in the "Source URL" field accordingly. In case you wish to compare with another version, you can find them all on the XWiki public Maven repository. To compare the source XAR with your current wiki, you may leave the "Target URL" field empty. 


The script will display a list of pages in XML format that have changed between the 2 versions. To see more details, click on the corresponding "View diff" link.


Import and Export Tools

This section provides 6 scripts that help you perform import/export actions that are not available in the standard distribution. 


The "Export" page is a form with 3 columns - the "Your Wiki" column allows you to select the space to export.


Your may either select the space from a drop-down list


or enter the space name in the "Search space" input followed by a click on the "Go" button.


Whichever option you choose, you will then see a listing with all the documents in the selected space.


Click on the "Select all" link in case you want to export the whole space or manually check each page to be added to the package. Next, click on the "Add to my package>>" button and you will notice that the selected pages will appear in the "Your Package" column.

The "Your Package" column displays the list of pages added to the package.


If you want to keep them all, just click on the "Select all" link. In case you want to remove some pages from the package, you need to select them, then to click on the "Remove from my package>>" button.

The "Package Info" column allows you to define the exported package metadata: the name, description, license, author and version.


By default, the application will only export the latest version of each page in the package. In case you want to also export the history, check the "Add history" option, then click on "Export" to confirm.

Export of the Wiki from a Specific Date

The page "Export of the Wiki from a specific date" allows to selectively export pages:

  • created at a given date - in this case you only need to fill in the "Date" field
  • created in a given interval - in this case you need to fill in both "Start Date" and "End Date" fields


Just like for the "Export" script, you have the option to export the history by checking the "With history" option. To keep the original author and creation date, you may additionally opt to export the XAR as "Backup pack".

Export Page

The difference between the classic XWiki Standard page export feature and the "Export Page" script is that the latter allows you to also export the page history by checking the option "With versions".


After clicking on "Export", you will be redirected to ServerName/xwiki/bin/view/Admin/ExportPage?type=export&name=Main.WebHome&versions=1 which should display a screen similar to the image below.


Import Page

The script "Import Page" allows you to import a single page XAR saved on the file system, with additional options:


  • "Page name to save to" - the name of the document to import the file to. If the page doesn't exist, it will be created, otherwise you may select one of the 5 possibilities:
  •  "Do Not overwrite with versions" - do not replace the content of the target page but keep the versions
  •  "Do Not overwrite without versions" - do not replace the content of the target page and don't keep the versions
  •  "Add version"
  •  "Overwrite with version" - replace the content of the target page and also keep the versions
  •  "Overwrite without versions" - replace the content of the target page but don't keep the versions

Large Export on Disk

The "Large Export on Disk" script is recommended for large wikis that cannot be exported using the standard feature because that could potentially cause a "Java Heap Space" error. 


The script allows you to select the spaces to export and, if you don't check the "Don't zip files, output to directory" option, each space will be exported to a corresponding folder and will contain XML files.


Large Import from Disk

The script "Large Import from Disk" does the reverse operation: allows to import a large .ZIP file containing XML pages into your wiki. To import the entire archive, check the "Import all" option.


Otherwise, hit "Submit", select the files you wish to import, then click on "Submit" again.


Just like for the "Import Page" script, you have 5 additional options:

  •  "Do Not overwrite with versions" - do not replace the content of the target page but keep the versions
  •  "Do Not overwrite without versions" - do not replace the content of the target page and don't keep the versions
  •  "Add version"
  •  "Overwrite with version" - replace the content of the target page and also keep the versions
  •  "Overwrite without versions" - replace the content of the target page but don't keep the versions

MySQL Tools

This section contains 6 dedicated scripts for database querying and diagnosis. 

MySQL Encoding Check

To check encoding, just run the "MySQL Encoding Check" script which returns:

  • General database character set settings information like:
    • character_set_client - the character set for statements that arrive from the client. The session value of this variable is set using the character set requested by the client when the client connects to the server. This should be set to utf8mb4.
    • character_set_connection - the character set used for literals that do not have a character set introduced and for number-to-string conversion. This should also be set to utf8mb4.
    • character_set_database - the character set used by the default database that should be set to utf8.
    • character_set_filesystem - the file system character set used to interpret string literals that refer to file names. It is recommended to set it to binary.
    • character_set_results - the character set used for returning query results such as result sets or error messages to the client.
    • character_set_server - the default character set of the server that should be set to utf8.
    • character_set_system - the character set used by the server for storing identifiers that should be always set to utf8.
A character set is a set of symbols and encodings.


  • General database collation settings:
    • collation_connection - the collation of the connection character set which should be set to utf8mb4_general_ci (case insensitive).
    • collation_database - the collation used by the default database which should be utf8_bin in order to have correct sorting for page names that start with special characters. For instance, you want "é" to come after "e", not after "z".
    • collation_server - the default collation of the server that should be set to utf8_general_ci.


A collation is a set of rules for comparing characters in a character set.
  • Encoding settings for the main wiki database:
    • collation of the main wiki database - it should be set to utf8_bin.
    • character set of the xwikidoc table - it must be utf8.
    • collation of the xwikidoc table - it must be utf8_bin.


XWiki Database Indexes Check

In case your wiki pages load really slow or if any wiki search takes too much time to return any results, the first thing you need to check is whether database indexes have been created. To do so, simply execute the "XWiki Database Indexes Check" script which returns the list of indexes not found. 

To create the missing indexes, simply execute the MySQL commands available in the "XWiki Database Schema" documentation.

Run Query

This script allows you to perform MySQL "SELECT" operations in the database. By default, the "URL" field is filled in for the main wiki database: "jdbc:mysql://localhost/upgrade1_xwiki?useServerPrepStmts=false&useUnicode=true&characterEncoding=UTF-8".
To query a sub-wiki, simply replace the database name.


Show Large History

This script displays pages with many versions that occupy a significant amount of space in the xwikircs table.


To clear the database history from the UI, simply call the "reset" action which will keep only the latest version and will reset it to "1.1". For instance, call ServerName/xwiki/bin/reset/Sandbox/Test and confirm.


Show Spammed Pages

This script displays the pages having more comments than a predefined threshold which default to "50".


You will then need to write a script that performs a comments cleanup.

Sanity Check

This script searches for database inconsistencies including:

  • objects and attachments for which the document doesn't exist anymore
  • attachments with no content
  • duplicate objects attached to the same page
  • comments and preferences for which the object doesn't exist anymore
  • properties declared as having a particular type but which are not in the correct table
  • translation documents marked as original documents
  • orphan translated documents



Related Pages

Trying to decide between Cloud and On Premise? See the comparison on the XWiki Help Center.

Search this space