This guide explains how to set up automatic and manual backups and how to migrate UCRM to another machine.
Table of Contents
- Automatic Backup
- Manual Backup
- Data Directory Storage
- How to Restore Using Backup Archive
- How to Restore From a Manual Backup
- Related Articles
Backups can be created and downloaded in System → Tools → Backup. You can configure which data is to be included in backup archives (client documents, invoice templates, etc.). An automatic backup is created once every 12 hours and takes this configuration into account. You can use this backup for restoring an older state of UCRM on the current server, or for migrating UCRM to another server.
NOTE: Note that invoice PDF files are never included in backup archives, as they are easily regenerated on demand.
The manual backup of the the UCRM app and all of its files is recommended only for advanced users. All UCRM data is stored in the /home/ucrm/data directory. For manual backup, you should copy this directory to a safe external storage. If you decide to create this backup of the complete data directory, make sure your UCRM is not currently in use.
sudo tar -cvjSf ucrm-data.tar.bz2 data docker-compose.env
Data Directory Storage
This is what is saved in each of the data directories below:
- /home/ucrm/data/ucrm - images, PDF invoices, encryption key, client documents, etc.
- /home/ucrm/data/postgres - PostgreSQL database - all other UCRM entities such as clients, payments, etc.
- /home/ucrm/data/rabbitmq - RabbitMQ data - draft approval queues, report generation queues, etc.
- /home/ucrm/data/elasticsearch - Elasticsearch index - unnecessary for backup, as it's always recreated on boot.
How to Restore Using Backup Archive
You can upload the archives back in System → Tools → Backup to the existing or new UCRM application and run the restore process.
ATTENTION: Current database will be dropped and all conflicting files will be overwritten by the ones in archive (for example, the organization logo image). Existing UCRM files, which are not included in the backup archive, will NOT be deleted during the restoring process.
How to Restore From a Manual Backup
ADVANCED CONFIGURATION: The preferred method of restoring a UCRM database is to use the UCRM Backup Archive in the GUI as mentioned above. This method is for advanced users only.
These steps will require a new UCRM installation and will guide you in manually restoring the backup files when using the Manual Backup instructions in this article.
1. Install UCRM on a clean instance
2. After a successful, new install: Stop UCRM using
cd /home/ucrm && sudo docker-compose stop
3. Delete the "data" folder (in clean installation)
rm -r /home/ucrm/data/
4. Delete the "docker-compose.env" file (in clean installation)
User Tip: Only delete these files in the new, clean UCRM instance. Do not delete these from an old UCRM instance with useful data!
5. Move the backup archive file to /home/ucrm
6. Extract the backup file in the /home/ucrm directory
tar xvjf ucrm-data.tar.bz2tar xvjf ucrm-data.tar.bz2
7. Edit File Permissions
sudo chown ucrm:ucrm docker-compose.env
sudo chmod 644 docker-compose.env
sudo chown -R ucrm:ucrm data
sudo chmod -R 777 data -d
8. Start UCRM again
cd /home/ucrm && sudo docker-compose up -d