Migrate from a Bitnami install to a manual install
Bitnami installs of ProcessMaker are only intended for testing and process development. If using ProcessMaker in production, it is strongly recommended to use a manual installation. If ProcessMaker is installed with Bitnami, it can't be upgraded and it is tested by the Quality Assurance team, so unexpected bugs may occur. In addition, Bitnami has additional overhead, which consumes more resources on the server.
This page explains how to migrate the workspace(s) in a Bitnami install to a manual install of ProcessMaker.
Step 1: Do a manual install of ProcessMaker
Follow the normal procedure documented on the wiki to manually install the same version of ProcessMaker as the Bitnami install. ProcessMaker can be installed on the same server, using different port numbers for MySQL and Apache or install ProcessMaker in another server.
Step 2: Export the workspace database(s)
In the Bitnami install of ProcessMaker, first stop the Apache server, so that the database won't be changed while exporting the MySQL database:
Open a terminal and issue the command
net stop processmakerApache to stop the Apache server, so the database won't be changed while exporting it:
C:\Users\Administrator> net stop processmakerApache<div style="margin-left:25px;"> The processmakerApache service is stopping. The processmakerApache service was stopped successfully.
Open a terminal and log in as root or use the
sudo -i command. Then, issue the command
service processmakerApache stop to stop the Apache server, so the database won't be changed while exporting it:
# service processmakerApache stop
Then, open the shared/sites/workspace/db.php to get information about the database used by each workspace.
Open the file C:\Bitnami\processmaker-3.X.X-X\apps\processmaker\htdocs\shared\sites\workspace\db.php for each workspace.
For example, the following command open the default workspace named "workflow" from the terminal:
Open the file /opt/processmaker-3.X.X.b1-X/apps/processmaker/htdocs/shared/sites/workspace/db.php for each workspace.
For example, the following command displays the db.php file for the default workspace named "workflow":
The db.php file holds information to connect to the workspace's MySQL database. For example:
<?php // Processmaker configuration define ('DB_ADAPTER', 'mysql' ); define ('DB_HOST', '127.0.0.1' ); define ('DB_NAME', 'bitnami_pm' ); define ('DB_USER', 'bn_processmaker' ); define ('DB_PASS', 'c261fc11ed' ); define ('DB_RBAC_HOST', '127.0.0.1' ); define ('DB_RBAC_NAME', 'bitnami_pm' ); define ('DB_RBAC_USER', 'bn_processmaker' ); define ('DB_RBAC_PASS', 'c261fc11ed' ); define ('DB_REPORT_HOST', '127.0.0.1' ); define ('DB_REPORT_NAME', 'bitnami_pm' ); define ('DB_REPORT_USER', 'bn_processmaker' ); define ('DB_REPORT_PASS', 'c261fc11ed' );
DB_NAME is the name of the MySQL database.
DB_NAME is the MySQL user and
DB_PASS is the MySQL password. This information will be used to login to MySQL.
Then, change to MySQL's bin directory if in Windows (not necessary in Linux). For example:
Then, use the mysqldump command to export each workspace's database. If just using the default workspace named "workflow" and the above example db.php file, then the command would be:
mysqldump -h 127.0.0.1 -u bn_processmaker -p bitnami_pm --single-transaction --quick --lock-tables=false > C:\Users\Administrator\workflow-backup.sql
After entering the password, which in this example is
c261fc11ed, the contents of the database will be placed in the file workflow-backup.sql. Make a backup copy for each workspace's database.
Step 3: Import the workspace database(s)
Then, import the workspace database(s) into the manual install of MySQL.
If using Windows, first change to the MySQL's bin directory. For example, if MySQL is installed at C:\Program Files\MySQL\MySQL 5.6.37:
cd "C:\Program Files\MySQL\MySQL 5.6.37\bin"
Then, use the command
mysql -u username -p database-name < backup-file.sql to import the backup file into a database.
For example, the following command will import into a new database named "pm_workflow":
mysql -u root -p pm_workflow < workflow-backup.sql
Then, login into MySQL as the "root" user (or another user which has the power to create new users):
mysql -u root -p
Then, use the
grant command to create the same user from the db.php file who will have full access to the imported database:
mysql> grant all on database.* to 'username'@'host' identified by 'password' with grant option;
If MySQL and Apache serving ProcessMaker are installed on the same server, then it is recommended to create users which connect from both localhost and 127.0.0.1. For example:
mysql> grant all on pm_workflow.* to 'bn_processmaker'@'127.0.0.1' identified by 'c261fc11ed' with grant option; mysql> grant all on pm_workflow.* to 'bn_processmaker'@'localhost' identified by 'c261fc11ed' with grant option;
If MySQL is located on a separate server, then the host will be the Apache server. For example, MySQL is installed at mysql.example.com and Apache is installed at pm.example.com, then the command will be:
mysql> grant all on pm_workflow.* to 'bn_processmaker'@'pm.example.com' identified by 'c261fc11ed' with grant option;
Each workspace has its own user, so do this for each workspace.
Step 4: Transfer the workspace files
The workspace files from the Bitnami installation need to be transfered to the 'shared directory in the manual installation.
If Bitnami is installed in Windows, then it is recommended to use the robocopy command to copy the workspace files:
robocopy C:\Bitnami\processmaker-3.X.X-X\apps\processmaker\htdocs\shared\sites\workspace destination-directory /E /copyall
For example, if replacing the existing "workflow" workspace, first move the manual installation's workflow directory to a new location to have a backup copy, then use robocopy to copy the workspace files to the manual installation:
move C:\opt\processmaker\shared\sites\workflow C:\Users\Administrator\workflow robocopy C:\Bitnami\processmaker-3.3.0-1\apps\processmaker\htdocs\shared\sites\workflow C:\opt\processmaker\shared\sites\workflow /E /copyall
Copy the workspace files from the Bitnami install to the manual install.
For example, if replacing the existing "workflow" workspace, first move the manual installation's workflow directory to a new location to have a backup copy, then copy the workspace files to the manual installation:
mv /opt/processmaker/shared/sites/workflow /root/backup/ cp -R /opt/processmaker-3.3.0.b1-0/apps/processmaker/htdocs/shared/sites/workflow /opt/processmaker/shared/sites/
Then, change the owner of the files to the apache user:
In CentOS/Red Hat:
chown -R apache:apache /opt/processmaker/shared/sites/workspace
chown -R www-data:www-data /opt/processmaker/shared/sites/workspace