System migration or recovery
Migrating or restoring the system from backup takes place in a few steps. Please read the information below to avoid any errors and mistakes.
Video guideβ
- π¬ YouTube
- π₯ YetiForce TV
Upload files to the web root directoryβ
It is best to unpack the files directly on the server, which will preserve the original permissions on the files.
If you have a separate copy of the storage directory, like in case of YetiForce Cloud you need to unpack the backup copy to __YETIFORCE_PATH__/storage
so that there is no storage directory in this directory, and only the following data directories instead: https://github.com/YetiForceCompany/YetiForceCRM/tree/developer/storage
Upload the databaseβ
Upload the database using the CLI console (recommended) or a database client eg. DBeaver, Database Workbench , SQLyog
mysql -P 3306 -h 127.0.0.1 -u yetiforce -p yetiforce < dump.sql
Update the configuration filesβ
After uploading the files and importing the database we should update the following files:
/** Backslash is required at the end of URL */
public static $site_URL = 'https://example.yetiforce.cloud/';
/** Gets the database server */
public static $db_server = 'localhost';
/** Gets the database port */
public static $db_port = '3306';
/** Gets the database user name */
public static $db_username = 'root';
/** Gets the database password */
public static $db_password = '';
/** Gets the database name */
public static $db_name = 'yetiforce';
The parameters below are also worth checking:
/** Restricted domains */
public static $EMAIL_FIELD_RESTRICTED_DOMAINS_VALUES = ['yetiforce.com','github.com'];
/** Allowed domains for loading images, used in CSP. */
public static $allowedImageDomains = [];
/** Generally allowed domains, used in CSP. */
public static $generallyAllowedDomains = ['yetiforce.com', 'github.com'];
/** List of allowed domains for fields with HTML support */
public static $purifierAllowedDomains = ['yetiforce.com', 'github.com'];
Verify if enforcing HTTPS is enabled. There might be problems if HTTPS was on the old server and the redirection was enabled and the new server has no active HTTPS.
/** Force site access to always occur under SSL (https) for selected areas. You will not be able to access selected areas under non-ssl. Note, you must have SSL enabled on your server to utilise this option. */
public static $forceHttpsRedirection = false;
Check if communication through proxy
is enabled
/** Proxy protocol: http, https, tcp */
public static $proxyProtocol = '';
/** Proxy host */
public static $proxyHost = '';
/** Proxy port */
public static $proxyPort = 0;
/** Proxy login */
public static $proxyLogin = '';
/** Proxy password */
public static $proxyPassword = '';
If you have a backup directory available on the server, you can enable it (this may require configuration of file permissions)
/** Backup catalog path. */
public static $BACKUP_PATH = '';
Check if configuration complies with requirementsβ
Whenever the system is migrated, restored from backup, or the LAMP server is updated, it is important to check the systemβs configuration in the built-in verification tool (Administrator documentation β Logs β Server - configuration) or in the article YetiForce requirements.
Don't use the server if it doesn't meet the requirements, as it may result in data loss. Fix any parameters that are highlighted in yellow or red.
It is also important that the owner of the files is the same as the user running the web server (apache, nginx).
CRONβ
Run CRON and verify its operation.
Re-register your systemβ
Migrating to a new server or restoring it from a backup requires re-registration of the system.
Update addonsβ
Some addons may need to be reconfigured when changing the location or address of the system, eg. System settings β Integration β Mail integration panel
.
YetiForce Outlook Integration Panelβ
Requires reinstallation and the installation of a new XML file.
The old addon installed in Outlook should be removed and the new XML file from the system panel should be downloaded according to the instructions.
Create a test environmentβ
If you create a test environment, it is worth introducing some important changes that will help you distinguish and secure the environments.
Change user passowrdsβ
Add visualsβ
Display a test environment notice on the login page and on the top bar of the system.
From version 6.2
it is possible to add in the configuration file config/Main.php some additional messages.
/** Header alert message */
public static $headerAlertMessage = '';
/** Header alert type, ex. alert-primary, alert-danger, alert-warning, alert-info */
public static $headerAlertType = '';
/** Header alert icon, ex. fas fa-exclamation-triangle, fas fa-exclamation-circle, fas fa-exclamation, far fa-question-circle, fas fa-info-circle */
public static $headerAlertIcon = '';
/** Login page alert message */
public static $loginPageAlertMessage = '';
/** Login page alert type, ex. alert-primary, alert-danger, alert-warning, alert-info */
public static $loginPageAlertType = '';
/** Login page alert icon, ex. fas fa-exclamation-triangle, fas fa-exclamation-circle, fas fa-exclamation, far fa-question-circle, fas fa-info-circle */
public static $loginPageAlertIcon = '';
Change the sender name in SMTP or disable the CRON task responsible for sending out emailsβ
Messages sent from the new environment will look the same as the ones sent from the production environment, so it is worth disabling or changing the sender names in SMTP to be able to distinguish between these e-mail messages.
Panel: System settings β Automation β CRON
Change API keysβ
It is worth changing the API access data to make them different for each environment. So that someone who has access to the test version will not be able to get data from the production version.
Panel: System settings β Integration β Web service - Applications
In order to properly transfer the system to another server, you should make a complete copy of the system (files and database). It is best to use compression software, e.g.
zip -r `date +"%Y%m%d_%H%M"`.zip __YETIFORCE_PATH__ -q
tar -zcvf /var/www/html/`date +"%Y%m%d_%H%M"`.tar.gz /var/www/html/
No error can occur during the transfer or recovery of the system, as the database may later turn out to be corrupted.