Ask questions about installing and configuring ProcessMaker 3

Moderator: amosbatto

By marcosfpa
#822213
I'm going to change my MySQL from the current server of my processor to another dedicated server to improve performance since I have 6 workspaces.
What is the best way to configure my current processmaker to set the new database as the default?
User avatar
By amosbatto
#822237
In your ProcessMaker server, stop the Apache service:
service httpd stop

Then make a backup of the six workspace databases. For example:
mysqldump -u root -h localhost -p --databases wf_workflow wf_space1 wf_space2 wf_space3 wf_space4 wf_space5 > /root/mysql_backup.sql

Then import all the databases to the other server:
mysql -u root -p < mysql_backup.sql

Then, you will need to edit the processmaker/shared/sites/{workspace]/db.php and processmaker/shared/sites/{workspace]/databases.php files for each workspace and change the address of the processmaker server to the address of the MySQL server.

For example if your MySQL server is located at 172.2.3.4 and your db.php file has the following content:
Code: Select all
<?php
// Processmaker configuration
  define ('DB_ADAPTER',     'mysql' );
  define ('DB_HOST',        'localhost' );
  define ('DB_NAME',        'wf_workflow330' );
  define ('DB_USER',        'wf_5c05d14cf006c' );
  define ('DB_PASS',        'z!4B_HPW13-etqr' );
  define ('DB_RBAC_HOST',   'localhost' );
  define ('DB_RBAC_NAME',   'wf_workflow330' );
  define ('DB_RBAC_USER',   'wf_5c05d14cf006c' );
  define ('DB_RBAC_PASS',   'z!4B_HPW13-etqr' );
  define ('DB_REPORT_HOST', 'localhost' );
  define ('DB_REPORT_NAME', 'wf_workflow330' );
  define ('DB_REPORT_USER', 'wf_5c05d14cf006c' );
  define ('DB_REPORT_PASS', 'z!4B_HPW13-etqr' );
Then, change it to:
Code: Select all
<?php
// Processmaker configuration
  define ('DB_ADAPTER',     'mysql' );
  define ('DB_HOST',        '172.2.3.4' );
  define ('DB_NAME',        'wf_workflow330' );
  define ('DB_USER',        'wf_5c05d14cf006c' );
  define ('DB_PASS',        'z!4B_HPW13-etqr' );
  define ('DB_RBAC_HOST',   '172.2.3.4' );
  define ('DB_RBAC_NAME',   'wf_workflow330' );
  define ('DB_RBAC_USER',   'wf_5c05d14cf006c' );
  define ('DB_RBAC_PASS',   'z!4B_HPW13-etqr' );
  define ('DB_REPORT_HOST', '172.2.3.4' );
  define ('DB_REPORT_NAME', 'wf_workflow330' );
  define ('DB_REPORT_USER', 'wf_5c05d14cf006c' );
  define ('DB_REPORT_PASS', 'z!4B_HPW13-etqr' );
Likewise, change to the address of the MySQL server in the databases.php file. For example, change from:
Code: Select all
<?php
$dbAdapter    = 'mysql';
$dbHost       = 'localhost';
$dbName       = 'wf_workflow330';
$dbUser       = 'wf_workflow330';
$dbPass       = 'z!4B_HPW13-etqr';
$dbRbacHost   = 'localhost';
$dbRbacName   = 'wf_workflow330';
$dbRbacUser   = 'wf_workflow330';
$dbRbacPass   = 'z!4B_HPW13-etqr';
$dbReportHost = 'localhost';
$dbReportName = 'wf_workflow330';
$dbReportUser = 'wf_workflow330';
$dbReportPass = 'z!4B_HPW13-etqr';
To:
Code: Select all
<?php
$dbAdapter    = 'mysql';
$dbHost       = '172.2.3.4';
$dbName       = 'wf_workflow330';
$dbUser       = 'wf_workflow330';
$dbPass       = 'z!4B_HPW13-etqr';
$dbRbacHost   = '172.2.3.4';
$dbRbacName   = 'wf_workflow330';
$dbRbacUser   = 'wf_workflow330';
$dbRbacPass   = 'z!4B_HPW13-etqr';
$dbReportHost = '172.2.3.4';
$dbReportName = 'wf_workflow330';
$dbReportUser = 'wf_workflow330';
$dbReportPass = 'z!4B_HPW13-etqr';
Then, login to MySQL in the new server from the command line and issue the GRANT command to allow users on the ProcessMaker server to login to the new MySQL server:
grant all on DATABASE.* to 'USER'@'ADDRESS' identified by 'PASSWORD' with grant option;

For example, if the ProcessMaker server is located at the address 172.4.5.6 and using the above db.php file, then the command would be:
grant all on wf_workflow330.* to 'wf_workflow330'@'172.4.5.6' identified by 'z!4B_HPW13-etqr' with grant option;

Do this for each workspace.

Also allow the MySQL root user to login from the ProcessMaker user if you intend to create new workspaces in the future:
grant all on *.* to 'root'@'172.4.5.6' identified by '[email protected]$w0rD' with grant option;

Then, login to ProcessMaker as the "admin" user in each workspace and verify that the databases are working in each workspace. Then go to Admin > Settings > Case List Cache Builder and click on the "Setup MySQL Root Password" section to expand it. Enter the address of the ProcessMaker server, the username "root" and the password and then click on the Setup Password button.
setMysqlRootPassword.png
setMysqlRootPassword.png (127.67 KiB) Viewed 709 times

Thank you i will be testing that

The check box is in the grid. I need to change th[…]

You need to use database queries in triggers to ge[…]

i still got error after add this header, This […]