To backup and restore dotCMS, it's recommended that you use external backup tools, as they provide the best and fastest results.
However, recent updates have begun to simplify certain manual steps below.
Performing a Backup
To completely backup dotCMS, you need to backup the following 6 resources:
- Your database
- For versions
22.02
or later using a PostgreSQL database, see the new simplified content exporting feature. - For all others, please see the Database Backup documentation for more information.
- For versions
- Your Assets
- For versions
22.02
or later, assets can be downloaded from the admin panel. - For all others, see: /dotserver/tomcat-X.xx/webapps/ROOT/assets
- For versions
- Your static Plugins folder
- /plugins
- Important:
- If changes to your dotCMS configuration are properly configured via configuration plugin, this is the only folder you need to backup to ensure your configuration changes are saved.
- If you've made configuration changes without using the configuration plugin, you will also need to manually backup all configuration files anywhere in the /dotserver hierarchy that you have changed.
- Your OSGI (dynamic) plugins folder
- /dotserver/tomcat-X.xx/webapps/ROOT/WEB-INF/felix/load
- Your ElasticSearch indexes
- /dotserver/tomcat-X.xx/webapps/ROOT/dotsecure/esdata
- Your license files
- /dotserver/tomcat-X.xx/webapps/ROOT/dotsecure/license.dat
- /dotserver/tomcat-X.xx/webapps/ROOT/dotsecure/server_id.dat
Recommended Tools
You may choose any appropriate tool to backup each resource, but please keep in mind the following recommendations:
- Make sure to use a database backup tool which is specifically designed for your database.
- For more information, please see the Database Backup documentation.
- For file and folder backup, we recommend that you use tools which can provide a complete snapshot of both the properties and contents (including permissions, dates, and symbolic links), such as tar or rsync.
- dotCMS provides command line tools to allow the backup of the running elasticsearch indexes.
- For more information, please see the Managing Site Indexes documentation.
Restoring from Backup
The following basic procedure can be used to restore your dotCMS installation from a previous backup.
Important: Even if your existing installation does not function properly, it is strongly recommended that you make a full backup of your existing installation before overwriting it with a backup. Please see Performing a Backup, above, for more information.
- Create a new dotCMS installation from the dotCMS distribution
- Note: You must make sure that the version of dotCMS matches the version of dotCMS you performed a backup of.
- Restore your database
- If a database exists with the same name as the backed up database, rename or drop (delete) the existing database.
- Create a new database with the same name as the original database.
- Restore your database backup into the new database.
- For more information, please see the Database Backup documentation.
- Restore the Assets directory from your backup
- Copy the assets folder from your backup to /dotserver/tomcat-X.xx/webapps/ROOT/.
- Restore the static Plugins folder from your backup
- Copy the /plugins folder from your backup to the root of the new dotCMS installation.
Important:
- If all changes to your dotCMS configuration are properly configured via configuration plugin, this is the only folder you need to restore.
- If you've made configuration changes without using the configuration plugin, you will also need to manually restore all configuration files anywhere in the /dotserver hierarchy that you changed.
- Restore the OSGI plugins folder from your backup
- Copy the /dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/felix/load folder from your backup to the same location in the new dotCMS installation.
- Restore the ElasticSearch index files from your backup
- Copy the esdata folder from your backup to /dotserver/Tomcat-X.xx/webapps/ROOT/dotsecure/.
- Restore the license files from your backup.
- Copy the license.dat and server_id.dat files from your backup to the /dotserver/Tomcat-X.xx/webapps/ROOT/dotsecure/.
- Redeploy your dotCMS plugins
- Run the deploy-plugins script (from the root of the new dotCMS installation):
- Linux:
bin/deploy-plugins.sh
- Windows:
bin\deploy-plugins.bat
- Linux:
- Run the deploy-plugins script (from the root of the new dotCMS installation):
- Start dotCMS
- Restore your Content Index
- Once dotCMS is running, restore the content index through the admin panel or via the command line.