In this article we will go through the required steps to backup a SugarCRM instance on Linux hosted on Fedora. The steps will be similar or the same for other distributions. File paths may vary depending on configuration.
Section 1 - SugarCRM Backup of the Filesystem
By default, Fedora places webserver files in the /var/www/html path. We are going to assume for this tutorial that you files are within that folder. For the steps below we will assume that your files are located under /var/www/html/sugarcrm
CAPS - Anything in caps will need to be replaced by data specific to your configuration.
1. Change directories to a home directory such as /home/USERNAME
Command: cd /home/USERNAME
2. Backup the folder
Command: tar -zcvf sugarcrm.tar.gz /var/www/html/sugarcrm
Section 2 - SugarCRM Backup of the Database
1. Backup Details
To backup the database you will need the name of the database, username and password. For this example let’s assume the following
Database: sugarprod
Username: sugaradmin
Password: sugarpass
2. SugarCRM Backup Folder
To backup the database it is easiest to start from the folder where we will backup to such as /home/USERNAME
Command: cd /home/USERNAME
3. SugarCRM Database Backup
Command: mysql -u sugaradmin -p sugarprod > sugardb.sql
Upon execution you will be prompted for the password.
Section 3 - Remove the files
1. SugarCRM Backup File Removal
There are multiple options for moving backup files.
The backup process can be implemented in a script and the files can automatically be moved to another location.
The files can be stored on the server.
The files can be downloaded locally.
For the purposes of this tutorial, we will outline how to download them locally.
2. SugarCRM Local Backup
Using an SCP client, login to the server hosting SugarCRM.
Browse to the SugarCRM backup files.
Copy the files to a local folder.
Remove the original files off of the server.
Mac users: Mac users can use their favorite scp command or client to retrieve the files from the server.
Windows users: Windows users can use their favorite SCP client. A popular Windows client is WinSCP.