Extension:PageSync

The PageSync extension allows for storing any wiki page content to a file on the server. Allowing for it be e.g. pushed to git or bitbucket and deployed on another server. The rationale for development of PageSync was to have all application artifacts, including templates, forms and other pages in the wiki, under version control.

PageSync has a maintenance script to import pages from file. This enables automatic deployment of wikis and transfer of content from one wiki to another.

PageSync is able to sync all Multi Revision Content slots and will also sync Files in the File namespace. Additionally you can save all synced files as a ZIP Archive and exchange the ZIP archive.

 Detailed Documentation can be found at the link below 

https://www.open-csp.org/DevOps:Doc/PageSync

Installation
Or install using Composer. Read more here : https://www.mediawiki.org/wiki/Composer/For_extensions

The Composer required name is : wikibase-solutions/page-sync

Configuration
PageSync needs a full path to a directory to store the file that can be synced. e.g.

This can be set in the localsettings as :

PageSync also needs a temporary file path to a directory to handle received Share file.

allowedGroups is a config setting telling PageSync what user groups can add pages to be synced. defaults to sysop.

Make sure these maps have the correct rights for PageSync to store files.

Files from the File namespace will also be synced.

You can define what slots you want to sync. Default value is all. If you change this value, make sure to add "main" for the main content-slot. or

Usage
See also the Special page section below.

Basically, if you are a sysop, any page that can be synced will have a slider in the top menu. Click on it and it will turn blue indicating it is synced ( a notification will also be shown ). If the slider is already blue when you visit a page, it simply means the page is already synced and is being monitored for changes. Click the slider again for the page to be excluded from syncing.

User rights
sysop/admins are allowed to set a page to be synced. All other users have no such ability.

Special Page
By default the special page shows a list of all Wiki pages set for syncing.

From the Special page you can also create, restore and delete ZIP backups. To be able to use ZIP Backups, make sure ZIPArchive is installed on your PHP setup.

The special page also allows for you to do a Semantic MediaWiki Query to quickly add certain pages to PageSync. This feature only works if you have SemanticMediaWiki extension installed.

The Special Page also shows all currently synced pages.

Creating PageSync Share files is also done from the Special page.

Finally you can also delete all synced pages from the Special page. This will not delete any pages in the Wiki, only the ones stored on the server by PageSync.

Update to version 0.9.9.9+
Since the structure of the files have changed as of version 0.9.9.9 to support Content Slots, some extra effort is needed if you are performing an upgrade. We have tried to make this very effortlessly. Once you have installed the 0.9.9.9+ update, visit the Wiki. You will notice the sync button in the admin menu has an exclamation mark. Click this and it will bring you to a Special page. Make sure you do not sync any pages to avoid possible failures. First thing you should do is use the new feature to create a backup. This will bring you to the backup tab and you can find your new backup file there. Click on the PageSync logo to go back to the convert page. Now click convert files preview. This will give you an overview of the files affected. Click on convert files to convert all the synced files to version 0.9.9.9.

Maintenance script
In order to import previous exported pages there is a Maintenance script that can be run.

Options

 * summary : Additional text that will be added to the files imported History.
 * user : Your username. Will be added to the import log. [mandatory]
 * rebuild-index : Rebuild the index file from existing files in export folder
 * force-rebuild-index : Used with 'rebuild-index' to suppress confirmation
 * rebuild-files : Will take the index file and re-create all files from the database
 * force-rebuild-files : Used with rebuild-files. This forces rebuild-files without prompting for user interaction

ShareFile import options
 * install-shared-file : Url or path on the server to a PageSync share file
 * install-shared-file-from-temp : Name of the PageSync Share file already in the PageSync TempPath
 * silent : Will show no output in the terminal until it is finished.

Scenario
We usually have a developing environment. When developing is done, we push our code to a repository. From there we create a Docker container and we deploy it to a Testing server. From there it is deployed to an Acceptance server and finally to production.

This is all fine with PHP and or JavaScript code, but we also create templates and widgets that are fundamental for it all to work properly.

With PageSync, we can now also push our Templates, Widgets or any important Wiki page to our repository. When deploying a container, the PageSync maintenance script is automatically run and therefore also updating pages in the Wiki.

Version history
Content aware slots added Maintenance script color difference between success and skipped Add before pagedisplay hook back in fixed bug when synced page was altered Add Installing Shared file from PageSync Repo. Rewrote code partly. Fixed installing Shared file bug Extra Share file checks added and non valid URL warning catched Seperated config from main Removed PHP notice and newline ( Gitlab #13 ) Added maintenance option rebuild-files to rebuild all files from the index. Fixed bug in Shared file import Added onArticleDelete hook ( this is deprecated, but we only support LTS versions of MW ) Fixed title look-up in conversion to version 2 New file management system to fix a problem with multi-language wikis Added overview installing shared file through Maintenance script Made maintenance option silent more silent. Added special option. Sharing Files added. Rename to PageSync. Rewrote deprecated 1.35.1+ code. Unchanged pages will no longer updates synced files on server Added support for different content types release Created handlers classes and clean Special Page. Added requirements. Added consistency in maintenance script fixed on page save Fixed weird username JavaScript error on one specific wiki Added support message when files are not in index. Removed debug information. Removed Maintenance script option --rc, --overwrite and --timestamp. Added slot support. Added rebuild index option. Added backup and restore. MW codestyle Sub special pages visual fix for most MW skins Not using user received from API anymore. Added check to only show sync button if a page can actually be synced. ( introduced by SkinTemplateNavigation::Universal ) Fix for skins other than Chameleon Delete un-used translations Clean-up Initial Community release
 * Version 2.1.4
 * Version 2.1.3
 * Version 2.1.2
 * Version 2.1.1
 * Version 2.1.0
 * Version 2.0.10
 * Version 2.0.9
 * Version 2.0.8
 * Version 2.0.6
 * Version 2.0.5
 * Version 2.0.4
 * Version 2.0.3
 * Version 2.0.2
 * Version 2.0.0
 * Version 1.5.2
 * Version 1.5.1
 * Version 1.5.0
 * Version 1.1.0
 * Version 1.0.1
 * Version 1.0
 * Version 1alpha5
 * Version 1alpha4
 * Version 1alpha3
 * Version 1alpha2
 * Version 1alpha1
 * Version 0.9.9.9
 * Version 0.9.9.8
 * Version 0.9.9.7
 * Version 0.9.9.6
 * Version 0.9.9.5
 * Version 0.9.9.4
 * Version 0.9.9.1 - 0.9.9.3
 * Version 0.9.9

Discord
Ask any question at the PageSync Discord server : https://discord.gg/T8VTjtXGnV