How To Migrate XL Release Or XL Deploy Repository To Another Database
By default, XL Deploy and XL Release store data in an embedded Apache Derby database, but you can configure another type of database if you would like. You can read this XL Deploy manual or this XL Release manual to learn how. However, what if you already have existing data in your repository? Then, in addition to reconfiguring your repository, you must also migrate the data to the new repository. This article will tell you how. The procedure aims to do following:
- Configure a new repository in the XL* installation directory
- Execute a script that will copy the data from old repository to the new one
- Reconfigure the XL* instance to point to the new repository
XL_HOME. These are specific steps you need to follow:
- Shut down the XL* instance cleanly. For XL Deploy, ensure that there are no running tasks before shutting down.
- Create a backup of the XL* instance configuration folder (
XL_HOME/conf) and repository (
XL_HOME/repository), including external database if you have it configured.
- Download and extract https://github.com/xebialabs-community/xld-repository-migration.
- From the extracted directory, copy the
bin/migrate.shscript to the
XL_HOME/binfolder and copy
- In the same
XL_HOME/binfolder, create a file called
jackrabbit-repository.xmlwith the new repository configuration; for example, with an external database instead of Apache Derby, or with attachment files stored in a database instead of in the file system (see this example).
- Open a command line and go to the
- Run the following command:
sh bin/migrate.sh -deployitHome ./ -jackrabbit-config-file ./bin/jackrabbit-repository.xml -repository-name repository-new -updateDeployitConfiguration
- Wait for the migration to complete.
- Start the XL* instance and verify that migration has completed successfully.
- To clean up the installation, restore the standard repository path and delete the copied files:
- Stop the XL* instance.
- Restore the original repository location in configuration file by replacing the new configuration file with the one that you backed up (the end of the file name shows the timestamp): in the case of XL Deploy,
XL_HOME/conf/deployit.conf, or in the case of XL Release,
- The migration script does not provide progress information during the procedure.
- The time the migration takes depends on the size of the repository and can range from minutes to hours. In our tests, a 1.2 GB repository running against a database on the same machine took approximately two hours to migrate.
- The Lucene index of the XL Deploy or XL Release instance is not migrated and will be regenerated while the instance is starting. The time this takes also depends on the size of the repository; it is possible that it takes hours.
- This guide was tested on XL Deploy 4.5.2 and XL Release 4.5.1. It is expected to work on other versions of these products as well, but we did not test it.