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.

AppPanelShortcut.png

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

Configuration Tools

ConfigurationTools.png

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 xwiki.store.cache.capacity 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".

CheckPR.png

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

    ShowLogs.png

  • 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

      ShowRights.png

  • 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.

    ShrinkRecycleBins.png

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. 

WikiDiff.png

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.

ViewDiff.png

Import and Export Tools

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

Export

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

YourWiki.png

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

SelectSpace.png

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

EnterSpace.png

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

SpaceList.png

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.

YourPackage.png

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.

PackageInfo.png

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

    ExportFromDate.png

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".

ExportPage.png

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.

ExportPageResult.png

Import Page

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

ImportPage.png

  • "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. 

ExportLargeWikis.png

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.

ExportNoZip.png

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.

ImportLargeFiles.png

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

SelectLargeImport.png

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.

GeneralDBSettings.png

  • 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.

GeneralDBCollationSettings.png

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.

MainWikiDBSettings.png

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.

RunQuery.png

Show Large History

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

ShowLargeHistory.png

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.

ConfirmResetHistory.png

Show Spammed Pages

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

ShowSpammedPages.png

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

SanityCheck.png

              

Related Pages

Search this space

 

Most popular tags

Failed to execute the [groovy] macro
  1. access rights
  2. activity stream
  3. annotation
  4. attachment
  5. comment
  6. Document Tree Macro
  7. export
  8. Extension Manager
  9. Flamingo skin
  10. global user
  11. Groovy event listener
  12. group
  13. nested page
  14. search
  15. skin
  16. syntax
  17. user
  18. user profile
  19. velocity macros
  20. wiki
  21. wysiwyg
  22. XWiki Applications
  23. xwikiattachment_archive table
  24. xwikiattachment table
  25. xwikiattrecyclebin table
  26. xwikiproperties table

[Display all tags from this space]