Backup and Restore

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 perform a backup of your dotCMS site, Navigate to the Maintenance > Tools screen and you can see three backup options:

Note on data consistancy.#

If you backup the database BEFORE you download the assets, the assets will be in a consistant state, as in dotCMS, the db is written before the assets saved in place and made consistant.

1. Backup Database#

By clicking backup database, dotCMS will perform a point in time database dump which can be downloaded and used to bootstrap a new dotCMS instance. The database backup can also be scripted using the API endpoint as well.

2. Backup Assets#

By clicking Backup Assets, dotCMS will give you the choice to download only the current version of assets (smaller), or all the versions of the assets(bigger). Once selected, dotCMS will zip/stream the contents of your asset directory to you based on your selection.

3. Backup App Configuration (optional)#

Navigate to the App screen and click the button on top called - Export All.

4. Insure you have your plugins#

You cannot download plugins from dotCMS once they have been uploaded into the system - they are assets that live and are built externaly to dotCMS.

Download a starter.zip (deprecated)#

Downloading a starter zip is a legacy way of taking a dotCMS backup. It downloads all assets/contents/obejcts in dotCMS in Object form and can take a substantial amount of time on large installations.

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.

  1. Create a new dotCMS installation from the dotCMS distribution

    • Note: You must make sure that the version of dotCMS you are restoring to is the same version OR NEWER as the backed up data and assets.
  2. Mount the assets directory from your backup

    • You want the the the assets folder from the assets backup to be mounted at /data/shared/assets. To do this, the easiest way is to extract the assets to a parent shared folder locally and mount THAT shared folder at /data/shared. This is because in a dotCMS cluster, other shared folders will be created for things like plugins.
  3. 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. `psql -f
  4. 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.
  5. Restore the ElasticSearch index files from your backup

    • Copy the esdata folder from your backup to /dotserver/Tomcat-X.xx/webapps/ROOT/dotsecure/.
  6. 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/.
  7. 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
  8. Start dotCMS

  9. Restore your Content Index

    • Once dotCMS is running, restore the content index through the admin panel or via the command line.