Skip to content
Lukas Bestle edited this page Jul 16, 2022 · 2 revisions

You can access the Versions plugin as a Panel view in the main hamburger menu. The Versions view displays the version of each instance and the open changes of the current instance as well as a list with all versions.

Screenshot of the Versions view in the Kirby Panel

The version list allows exporting a ZIP file of the version, deploying it to any connected site instance and deleting the version.

Version List

You can create new versions from the current content state at any time using the "Create Version" button above the list of changes at the top.

Create a version

Creating a new version is only possible if no user has unsaved changes (unless .lock files are ignored in .gitignore, see the setup instructions).

Before the version is created, the plugin will display a list of changes included in the version so that you can verify what has changed. You can then give the version a custom label and create the version with the click of a button.

Version Creation Dialog

Export to ZIP file

Version Export Dialog

Clicking the export button will export a ZIP file with all content files of the selected version and place it in the media directory. You can either download the ZIP file directly or copy the URL to the clipboard for sharing.

The ZIP file can be downloaded by anyone knowing the direct URL. It is automatically deleted after two hours.

By creating a content/.gitattributes file, you can configure which files are excluded from the export (but still saved in the versions that are created). This can be useful for sensitive information like customer data. You can read more about the export-ignore feature in the Git documentation.

Deploy a version to the same or a different instance

Version Deployment Dialog

After clicking on the deploy button, the plugin will ask you what the deploy destination (any of the configured site instances) should be.

The plugin will verify that the target site does not have any unversioned changes (otherwise it will create an automatic snapshot). Once everything is clean, it will switch the target site to the selected version.

Delete a version

Version Deletion Dialog

The delete button will (after confirmation) delete the underlying Git tag of the version, which will make the version disappear from the list in the Panel.

Because of how Git works internally, old versions can still be recovered from the Git commit history (git log), but only if the old version you want to recover was used as the base for any version that still exists.

Example: Based on the initial version, you have created two versions A1 and B1, each changing the prior version (A1 changes the initial version and B1 changes A1). You have then switched back to version A1 and created version B2 based on A1. If version B1 is deleted, it will be gone as no other version still references it – Git will garbage-collect it soon. However it will always be possible to recover the initial version and version A1 even if they are deleted as both B1 and B2 are based on them.

If the content repository gets too large after many larger changes, you can reset it by deleting the content/.git directory and following the setup steps again. Make sure to create a backup of the .git directory before deleting it in case you still need changes from it later.