This is an example Hippo CMS database migration project following the recipe-for-hippo-db-migration project.
This demo project simply migrates an H2 based repository to another H2 based repository for demonstration purpose.
- Build with
mvn clean verify
. - Run the demo project with
mvn -P cargo.run -Drepo.path=source-storage
. - Make sure to turn off "Auto-export" feature, not to generate bootstrap files. So, your content change won't be serialized to bootstrap YAML files in source.
- Add or update some news or events documents
- Stop the tomcat.
- In this demo project, the migration subsystem is already prepared in the recipe-for-hippo-db-migration subfolder. So, you may copy or prepare files to the folder in the following.
- Follow Step 3: Copy all the necessary JAR files to lib/ directory.
- You may download jackrabbit-standalone-2.16.2.jar as Hippo CMS 12.3 uses Jackrabbit 2.16.x.
- You should donwload hippo-addon-checker-2.1.0.jar.
- And the other files under Tomcat can be found under
target/tomcat8x/
folder once you've runmvn -P cargo.run
.
- First, copy the
source-storage
folder in the project root torecipe-for-hippo-db-migration/
folder. - Copy
recipe-for-hippo-db-migration/source-storage/workspaces/default/workspace.xml
file torecipe-for-hippo-db-migration/source-storage/workspaces/default/workspace-origin.xml
. - Edit
recipe-for-hippo-db-migration/source-storage/workspaces/default/workspace.xml
to keep only<FileSystem>
and<PersistenceManager>
elements by copying those from recipe-for-hippo-db-migration/conf/source-repository.xml. See Step 2 for detail. - In the recipe-for-hippo-db-migration subfolder, execute the following command:
$ sh bin/migrate.sh \
--conf conf/source-repository.xml \
--backup-conf conf/backup-repository.xml \
--repo source-storage \
--backup-repo backup-storage
- The above command will create
recipe-for-hippo-db-migration/backup-storage
folder and copy all database to that folder.
- Copy
recipe-for-hippo-db-migration/backup-storage
folder tostorage
folder in the project root folder. - Remove
storage/workspaces/default/workspace.xml
file copy thesource-storage/workspaces/default/workspace-origin.xml
(which you backup in the earlier step) tostorage/workspaces/default/workspace.xml
. - Run the demo project with
mvn -P cargo.run -Drepo.path=storage
. - Make sure your new or updated content are there after the migration.