Sie sind auf Seite 1von 16

2.

0/Backing up and Restoring


ProcessMaker
Tweet
Bagikan 0
From ProcessMaker
Contents
1 Backing up Workspaces
1.1 Backing up Bigger Workspaces
1.2 Backing up Multiple Workspaces
1.3 Automating Backups
1.3.1 Linux/UNIX
1.3.1.1 Inserting Date/Time in Filenames
1.3.1.2 Storing Backups Remotely
1.3.2 Windows
1.3.2.1 Inserting Date/Time in Filenames
1.3.2.2 Storing Backups Remotely
2 Restoring Workspaces
2.1 Importing Workspaces from ProcessMaker 1.X into 2.X
2.2 Importing Workspaces into newer versions of 2.X
3 Manual Backup and Restore
3.1 Automating Backups
3.2 Restoring ProcessMaker
ProcessMaker holds vital information about your organization's users and their work;
therefore, it is very important you establish and maintain a backup system to safeguard
the data being stored in ProcessMaker. If periodic backups aren't being made, one
lightning strike or an accidental deletion of key files on your system could bring your
organization to a grinding halt. Backups can also be very useful for returning to a
previous state after making experimental changes to your system or applying an
upgrade patch to ProcessMaker.
It is recommended that your entire system be backed up in case the entire operating
system needs to be restored. For the data stored in ProcessMaker, it is recommended to
periodically backup your workspaces. Depending on how critical your data is and how
often it is being updated, a daily backup or a weekly backup would be appropriate.
Share Share
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
1 of 16 06/25/2014 03:57 PM
ProcessMaker version 2.0 offers the new "processmaker" command line utility to backup
and restore Workspaces, which solves the limitations (http://bugs.processmaker.com
/view.php?id=5547) of the previous backup and restore utility offered by the "gulliver
workspace-backup" command in ProcessMaker version 1.X. If still using ProcessMaker
version 1.X, see this page.
Backing up Workspaces
The workspace backup utility creates a tar file which contains a dump of the three
databases for each workspace and its associated files, which are stored in the INSTALL-
DIRECTORY/shared/sites/WORKSPACE/ directory. Additional workspaces can be created in
ProcessMaker, but most installations of ProcessMaker will have the default "workflow"
workspace, which uses the wf_workflow, rb_workflow, and rp_workflow databases and stores
its files in the shared/sites/workflow/ directory.
To backup a workspace, open a command line prompt in the server running
ProcessMaker.
Hint: If unable to find the command line prompt, in Windows, go to Start > All
Programs > Accessories > Command Prompt. If using a GNOME-based Linux/UNIX
system, in the main menu, go to Accessories > Terminal.
Note for Linux/UNIX: If the shared directory has been set to 770 permissions for
security reasons, then login as "root" or sudo when backing up a workspace. Another
option is to add your user to the apache group (which is "apache" for Red Hat/CentOS
/Fedora, "www-data" for Debian/Ubuntu, and "www" for SUSE/OpenSUSE), so that
user can do backups:
useradd -G apache-group username
Navigate to the directory where ProcessMaker is installed. For example:
Linux/UNIX:
cd /opt/processmaker
Windows XP/Server 2003:
cd "C:\Program Files\ProcessMaker-2_0_23\processmaker"
Windows Vista/7/Server 2008:
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
2 of 16 06/25/2014 03:57 PM
cd C:\Users\USERNAME\AppData\Roaming\ProcessMaker-2_0_23\processmaker
Then, issue the command to backup a workspace:
processmaker workspace-backup WORKSPACE [BACKUP-FILE]
WORKSPACE is the name of the workspace to backup. Remember that workspace names are
case sensitive.
By default, the backup file will be created at INSTALL-DIRECTORY/shared/backups
/WORKSPACE.tar, however the location of the backup file can be specified with the optional
BACKUP-FILE parameter. This parameter can include forward slashes "/" to specify a path
in Linux/UNIX or backward slashes "\" to specify a path in Windows. If the path or
filename contains spaces, enclose it in double quotation marks. If using a relative path,
then it will start from the location of the processmaker script. If no path is specified, then
the file will be created in the shared/backups directory.
Note: If using Linux/UNIX, it is necessary to specify the directory where the
processmaker script is located, so prepend "./" to specify the current directory:
./processmaker workspace-backup WORKSPACE [BACKUP-FILE]
Examples:
Backup the default "workflow" workspace on a Linux/UNIX server to the location
/opt/processmaker/shared/backups/workflow.tar:
./processmaker workspace-backup workflow
Backup the "sales" workspace on a Linux/UNIX server to the location "/home
/amos/store/pm_sales.tar":
./processmaker workspace-backup sales /home/amos/store/pm_sales.tar
Backup the "Finance" workspace to the location /opt/store/Finance/FinanceBackup.tar,
using a relative path:
./processmaker workspace-backup Finance ../store/FinanceBackup.tar
Backup the "sales" workspace on a Windows server to the location C:\Documents and
Settings\Amos\sales backup.tar. Remember to enclose paths and filenames with spaces
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
3 of 16 06/25/2014 03:57 PM
in double quotes:
processmaker workspace-backup sales "C:\Documents and Settings\Amos\sales backup.tar"
For help using the workspace-backup option, enter the command:
processmaker help workspace-backup
While executing a workspace backup, the output will indicate which tables are being
backed up and print a summary of the backup at the end, similar to the following:
$ cd /opt/processmaker
$ ./processmaker workspace-backup workflow
Backing up to /opt/processmaker/shared/backups/workflow.tar
Backing up database...
Saving database wf_workflow
LOCK TABLES [OK]
Dump of table ADDITIONAL_TABLES 294 Bytes Saved
Dump of table APPLICATION 43950 Bytes Saved
Dump of table APP_CACHE_VIEW 24274 Bytes Saved
Dump of table APP_DELAY 0 Bytes Saved
Dump of table APP_DELEGATION 18370 Bytes Saved
Dump of table APP_DOCUMENT 3324 Bytes Saved
Dump of table APP_EVENT 0 Bytes Saved
Dump of table APP_FOLDER 0 Bytes Saved
Dump of table APP_HISTORY 3000 Bytes Saved
Dump of table APP_MESSAGE 0 Bytes Saved
Dump of table APP_OWNER 0 Bytes Saved
Dump of table APP_THREAD 5115 Bytes Saved
Dump of table CALENDAR_ASSIGNMENTS 0 Bytes Saved
Dump of table CALENDAR_BUSINESS_HOURS 106 Bytes Saved
Dump of table CALENDAR_DEFINITION 170 Bytes Saved
Dump of table CALENDAR_HOLIDAYS 0 Bytes Saved
Dump of table CASE_SCHEDULER 0 Bytes Saved
Dump of table CASE_TRACKER 96 Bytes Saved
Dump of table CASE_TRACKER_OBJECT 0 Bytes Saved
Dump of table CONFIGURATION 6686 Bytes Saved
Dump of table CONTENT 72907 Bytes Saved
Dump of table DB_SOURCE 0 Bytes Saved
Dump of table DEPARTMENT 0 Bytes Saved
Dump of table DIM_TIME_COMPLETE 0 Bytes Saved
Dump of table DIM_TIME_DELEGATE 0 Bytes Saved
Dump of table DYNAFORM 4041 Bytes Saved
Dump of table EVENT 1079 Bytes Saved
Dump of table EXP_CATEGORY 181 Bytes Saved
Dump of table EXP_ITEM 819 Bytes Saved
Dump of table FIELDS 829 Bytes Saved
Dump of table FIELD_CONDITION 0 Bytes Saved
Dump of table GATEWAY 876 Bytes Saved
Dump of table GROUPWF 290 Bytes Saved
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
4 of 16 06/25/2014 03:57 PM
Dump of table GROUP_USER 530 Bytes Saved
Dump of table HOLIDAY 0 Bytes Saved
Dump of table INPUT_DOCUMENT 286 Bytes Saved
Dump of table ISO_COUNTRY 15891 Bytes Saved
Dump of table ISO_LOCATION 4453699 Bytes Saved
Dump of table ISO_SUBDIVISION 66412 Bytes Saved
Dump of table LANGUAGE 11202 Bytes Saved
Dump of table LEXICO 0 Bytes Saved
Dump of table LOGIN_LOG 10096 Bytes Saved
Dump of table LOG_CASES_SCHEDULER 0 Bytes Saved
Dump of table OBJECT_PERMISSION 0 Bytes Saved
Dump of table OUTPUT_DOCUMENT 854 Bytes Saved
Dump of table PROCESS 1640 Bytes Saved
Dump of table PROCESS_CATEGORY 0 Bytes Saved
Dump of table PROCESS_OWNER 0 Bytes Saved
Dump of table PROCESS_USER 0 Bytes Saved
Dump of table REPORT_TABLE 446 Bytes Saved
Dump of table REPORT_VAR 2445 Bytes Saved
Dump of table ROUTE 5381 Bytes Saved
Dump of table SESSION 179 Bytes Saved
Dump of table SHADOW_TABLE 7058 Bytes Saved
Dump of table STAGE 0 Bytes Saved
Dump of table STEP 3310 Bytes Saved
Dump of table STEP_SUPERVISOR 0 Bytes Saved
Dump of table STEP_TRIGGER 3447 Bytes Saved
Dump of table SUB_APPLICATION 0 Bytes Saved
Dump of table SUB_PROCESS 192 Bytes Saved
Dump of table SWIMLANES_ELEMENTS 2269 Bytes Saved
Dump of table TASK 7833 Bytes Saved
Dump of table TASK_USER 848 Bytes Saved
Dump of table TRANSLATION 799302 Bytes Saved
Dump of table TRIGGERS 7245 Bytes Saved
Dump of table USERS 1925 Bytes Saved
Dump of table USERS_PROPERTIES 320 Bytes Saved
UNLOCK TABLES [OK]
Saving database rp_workflow
LOCK TABLES [OK]
Dump of table EXP_DETAILS 0 Bytes Saved
Dump of table EXP_EXPENSES 515 Bytes Saved
UNLOCK TABLES [OK]
Saving database rb_workflow
LOCK TABLES [OK]
Dump of table AUTHENTICATION_SOURCE 0 Bytes Saved
Dump of table PERMISSIONS 2969 Bytes Saved
Dump of table ROLES 709 Bytes Saved
Dump of table ROLES_PERMISSIONS 3277 Bytes Saved
Dump of table SYSTEMS 260 Bytes Saved
Dump of table USERS 1440 Bytes Saved
Dump of table USERS_ROLES 642 Bytes Saved
UNLOCK TABLES [OK]
Copying database to backup...
+ /opt/processmaker/shared/upgrade/EB0oxI
Copying files to backup...
+ /opt/processmaker/shared/sites/workflow
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
5 of 16 06/25/2014 03:57 PM
ProcessMaker Version 2.0.23
System Ubuntu 10.04 LTS (Linux)
PHP Version 5.2.10-2ubuntu6
Server Address 192.168.1.76
Client IP Address 192.168.0.168
Plugins charts
openFlash
pmosCommunity
processTemplate
Workspace Name workflow
Workflow Database mysql://wf_workflow:4dsmjw378rgh@localhost:3306/wf_workflow
RBAC Database mysql://rb_workflow:4dsmjw378rgh@localhost:3306/rb_workflow
Report Database mysql://rp_workflow:4dsmjw378rgh@localhost:3306/rp_workflow
MySql Version MySql (Version none)
Backing up Bigger Workspaces
Available version: From 2.5
Sometimes, the backup is too big to be handled in some OS configurations. To solve this
issue a new parameter -s was added to back up workspaces with files bigger than 2 GB
in size, this parameter allows to compress the file into several ones:
./processmaker workspace-backup -s [ <megabyte_max_files_size>] WORKSPACE [BACKUP-FILE]
Where:
megabyte_max_files_size: parameter to specify the size, in parts, file will be
compress, for instance if it is a file of 2 GB to backup, this parameter may be
defined with 1024, it means the it wilb be compress in two parts of 1024 MB.
If -s parameter is not used, the command above won't back up files more than 2 GB in
size.
Note: This parameter can only be used under Linux Servers.
Backing up Multiple Workspaces
From version 2.0.23 on, it is possible to backup multiple workspace at the same time,
with the command:
processmaker workspace-backup WORKSPACE1 [WORKSPACE2 WORKSPACE3...] BACKUP-FILE
Separate each workspace name with a space. The last parameter will be considered the
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
6 of 16 06/25/2014 03:57 PM
name of the backup file.
For example to backup, the "workflow", "sales" and "Finance" workspaces to the file
"pmBackup.tar":
./processmaker workspace-backup workflow sales Finance pmBackup.tar
Automating Backups
Backups should be made periodically, so it is best to automate the backup process.
Linux/UNIX
In Linux/UNIX, the backups can be scheduled as a cron job. For more information on the
format of the crontab file, see Configuring crontab in Linux/UNIX.
For example, the following line could be added to the /etc/crontab file to automatically
backup the "workflow" workspace every 12 hours and save it to a file at
/opt/processmaker/backups/workflow.tar:
* */12 * * * root /opt/processmaker/processmaker workspace-backup workflow
Inserting Date/Time in Filenames
The problem is that the backup file will be overwritten every 12 hours, so it will not be
possible to use the processmaker workspace-restore command to roll the workspace back to
a state which is older than 12 hours. For example, if a database gets corrupted 3 days
ago, the backup file will have already been overwritten, so it isn't possible to recover
the old database. Therefore, it is recommended to use a time stamp in the backup file
name, so multiple backup files can be maintained. However, old backup files also need
to be periodically eliminated so that the backups don't eat up all the harddrive space on
the server.
These cron jobs could be used to make a backup file every 12 hours and save it to a file
at /root/backups/workflow_YYYY-MM-DD_HH-MM.tar, and automatically delete the old backup
files which are more than 30 days old:
* */12 * * * root /opt/processmaker/processmaker workspace-backup workflow /root/backups/workflow_`date +%F
* */23 * * * root tmpwatch 720 /root/backups
The current date and time is automatically inserted into the filename with the date
command, such as "workflow_2011-03-21_12-01.tar". Make sure to use `` (backticks), so
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
7 of 16 06/25/2014 03:57 PM
Linux/UNIX will execute the date command, rather than treating it like a quoted string.
The second command automatically deletes any files older than 30 days (30days x
24hours = 720hours) in the /root/backups/ directory every night at midnight, so old
backup files will not occupy too much space. If on a Debian or Ubuntu server, use the
tmpreaper (http://pwet.fr/man/linux/administration_systeme/tmpreaper) command
instead of tmpwatch (http://linux.die.net/man/8/tmpwatch) .
Storing Backups Remotely
It is recommended to keep backup copies in a different server (in a different location),
so that a harddrive failure or lightning strike in the ProcessMaker server won't also
destroy the backup copies. The following script named "/usr/local/bin/pmbackup.sh" could
be used to make a backup of the "workflow" workspace and store it in another location:
#!/bin/bash
CURDATE=$(date +%F_%H-%M)
/opt/processmaker/processmaker workspace-backup workflow /root/backups/workflow_$CURDATE.tar
gzip /root/backups/workflow_$CURDATE.tar
scp /root/backups/workflow_$CURDATE.tar.gz root@backups.example.com:/root/backups/
rm /root/backups/workflow_$CURDATE.tar.gz
Make sure that the script file is executable:
chmod +x /usr/local/bin/pmbackup.sh
In order to be able to copy the backup files to the remote server at
backups.example.com without having to enter a password for the root user, generate a
public/private key with the command:
ssh-keygen -t rsa
Add the public key to the /root/.ssh/authorized_keys file in the backups.example.com
server. For more information, see this article (http://www.linuxjournal.com/article
/8600) . Then, add the pmbackup.sh script as a cron job on the ProcessMaker server.
* */23 * * * root /usr/local/bin/pmbackup.sh
Windows
On Windows servers, workspaces can be periodically backed up as a Scheduled Task.
Use the SCHTASKS (http://technet.microsoft.com/en-us/library
/cc725744%28WS.10%29.aspx) command in DOS to create a Scheduled Task which
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
8 of 16 06/25/2014 03:57 PM
periodically executes the processmaker workspace-backup command. For more information
on using the SCHTASKS command, see Executing cron.php with the SCHTASKS command.
Examples:
1. Backup the default "workflow" workspace every day at midnight and 1pm (during
the lunch break) on a ProcessMaker server installed at C:\Users\Bob\AppData\Roaming
\ProcessMaker-2_0_30\processmaker:
SCHTASKS /Create /U administrator /P p4s5w0rd /SC DAILY /ST 00:00,13:00 /TR ^
"C:\Users\Bob\AppData\Roaming\ProcessMaker-2_0_30\processmaker\processmaker workflow-backup workflow"
2. Backup the "sales" workspace to the file C:\Documents and Settings\Bob\Backups\sales
workspace.tar every Sunday and Wednesday at midnight on a ProcessMaker server
installed at C:\Program Files\ProcessMaker-2_0_30\processmaker:
SCHTASKS /Create /U administrator /P p4s5w0rd /SC WEEKLY /D SUN,WED ST/ 00:00 /TR ^
"'C:\Program Files\ProcessMaker-2_0_30\processmaker\processmaker' workflow-backup sales 'C:\Documents and
Notice how paths and file names which contain spaces are enclosed inside single
quotation marks.
3. Backup the "sales" workspace to the file SalesBackup.tar on the 15th of every month
at 11pm:
SCHTASKS /Create /U administrator /P p4s5w0rd /SC MONTHLY /D 15 /ST 23:00 /TR ^
"C:\Users\Bob\AppData\Roaming\ProcessMaker-2_0_30\processmaker\processmaker workflow-backup sales SalesBa
Inserting Date/Time in Filenames
It is not possible to insert the current date and time in the backup filename using the
system %date% and %time% variables, since SCHTASKS treats them as literal strings. Instead,
create a .bat file to execute the processmaker workspace-backup command. For example, the
file C:\Users\Bob\pmbackup.bat contains:
C:\Users\Bob\AppData\Roaming\ProcessMaker-2_0_30\processmaker\processmaker workflow-backup workflow workflow-
Then, use the SCHTASKS command to schedule the periodic execution of the C:\Users
\Bob\pmbackup.bat file:
SCHTASKS /Create /U administrator /P p4s5w0rd /SC DAILY /ST 00:00,13:00 /TR "C:\Users\Bob\pmbackup.bat"
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
9 of 16 06/25/2014 03:57 PM
Storing Backups Remotely
To securely copy files from Windows, install PuTTY's
(http://www.chiark.greenend.org.uk/~sgtatham/putty/) pscp (http://the.earth.li/~sgtatham
/putty/0.60/htmldoc/Chapter5.html) program in the ProcessMaker server. Then, create a
.bat file to execute the processmaker workspace-backup command and use pscp to copy the
backup file to a remote server.
For example, the file C:\Documents and Settings\Bob\pmbackup.bat contains the following
code to copy the backup file to the /root/backups directory on a remote Linux/UNIX
server with a domain name of "example.com":
"C:\Program Files\ProcessMaker-2_0_30\processmaker\processmaker" workflow-backup workflow
"C:\Program Files\PuTTY\PSCP.EXE" -pw p4s5w0rd "C:\Program Files\ProcessMaker-2_0_30\processmaker\backups\wor
Then, use the SCHTASKS command to schedule the periodic execution of the C:\Documents
and Settings\Bob\pmbackup.bat file:
SCHTASKS /Create /U administrator /P p4s5w0rd /SC DAILY /ST 00:00 /TR "Documents and Settings\Bob\pmbackup.ba
To copy the backup files to a remote Windows server, install an SSH server on the
remote Windows server (with programs such as freeSSHd (http://www.freesshd.com) ,
CygWin (http://www.cygwin.com) or WinSSHD (http://www.bitvise.com/winsshd) ), so it
can accept secure file transfers. Another option is using PuTTY's
(http://www.chiark.greenend.org.uk/~sgtatham/putty/) psftp (http://the.earth.li
/~sgtatham/putty/0.60/htmldoc/Chapter6.html#psftp) command to transfer the files
using the SFTP protocol.
Restoring Workspaces
To restore a workspace from a backup, use the command:
processmaker workspace-restore BACKUP-FILE [WORKSPACE]
If the backup file has an extension of ".tar" and it is located in the shared/backups
directory, then it is not necessary to specify the path or the extension.
Note: The response time of the workspace-restore command has been improved,
reducing considerably the time spent in restoring cases. This great improvement was
added from version 2.5.2.
For example, to restore from the shared/backups/workflow.tar backup file in Linux/UNIX:
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
10 of 16 06/25/2014 03:57 PM
./processmaker workspace-restore workflow
If the backup file is not located in the shared/backups directory or it doesn't have an
extension of ".tar", then specify the path. Remember to enclose it within double quotes
if the file name or path contains spaces. For example, to restore a workspace from the
"c:\Documents and Settings\Amos\sales backup.tar" file in Windows:
processmaker workspace-restore "c:\Documents and Settings\Amos\sales backup.tar"
By default the backup will be restored to the same workspace name and use the same
databases names as the original. To overwrite an existing workspace, use the -o or
--overwrite option. For example, to overwrite the existing "workflow" workspace:
./processmaker workspace-restore -o template_name workflow
To restore to a different workspace name, specify the optional WORKSPACE parameter. A
new workspace will be created with 3 databases named "wf_WORKSPACE", "rb_WORKSPACE" and
"rp_WORKSPACE". The workspace name should only use valid characters for MySQL
databases, so it can not contain hyphens "-", spaces, periods, commas, semicolons or
other special characters. To avoid problems, it is recommended to only use ASCII letters,
numbers and underscores "_" for workspace names, since the workspace name should
be easy to represent in a web address. Remember that workspace names are case
sensitive when being entered in a URL in a web browser, but MySQL databases in
Windows are not case sensitive, whereas MySQL databases in Linux/UNIX are case
sensitive.
For example, to import the backup file at "shared/backups/workflow.tar" with the
workspace name of "finance":
./processmaker workspace-restore -o workflow finance
To only show information about a backup file, use the -i option. For example, to show
information about the workspace(s) in the sales.tar backup file:
./processmaker workspace-restore -i sales
To restore a workspace from a backup file which has multiple workspaces, use the -w or
--workspace= option to specify which workspace should be restored. For example, to
restore the "Finance" workspace from the file pmBackup.tar and overwrite the existing
"accounting" workspace:
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
11 of 16 06/25/2014 03:57 PM
./processmaker workspace-restore -o --workspace=finance pmBackup finance
or:
./processmaker workspace-restore -o pmBackup finance
For help using the processmaker workspace-restore command:
processmaker help workspace-restore
To restore workspaces with more than 2 GB in size run the following command:
./processmaker workspace-restore -m <workspace> <destinationFile.tar> <workspacedestination>
This command is available from version 2.5
Note: If - m parameter is not used, the command above won't restore workspaces with
more than 2 GB in size. This parameter can only be used under Linux Servers.
Note for Linux/UNIX: All the workspace files from the backup will be created in the
INSTALL-DIRECTORY/shared/sites/WORKSPACE/ directory, with the same file permissions and
same file owner as the shared directory. If needing greater security, change those file
permissions.
Importing Workspaces from ProcessMaker 1.X into 2.X
If a backup was made of a workspace in ProcessMaker 1.X with the gulliver workspace-
backup command, then the best option is to import that workspace into the same version
of ProcessMaker using the gulliver workspace-restore command. Then, upgrade that
installation of ProcessMaker to version 2.X.
If ProcessMaker is already version 2.X, so it can't be upgraded, then it is still possible to
import the old backup file using the the gulliver workspace-restore command. However,
after restoring the workspace, the database tables and workspace files need to be
upgraded to match version 2.X, by changing to the INSTALL-DIRECTORY and issuing the
processmaker upgrade command:
cd INSTALL-DIRECTORY
./processmaker upgrade
Importing Workspaces into newer versions of 2.X
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
12 of 16 06/25/2014 03:57 PM
If importing a workspace which was created in an older version of ProcessMaker 2.X
into a newer version of ProcessMaker 2.X, then use the processmaker workspace-restore
command. Afterwards, update the database tables and workspace files to the new
version, by changing to the INSTALL-DIRECTORY and issuing the processmaker upgrade
command:
cd INSTALL-DIRECTORY
./processmaker upgrade
Manual Backup and Restore
Automating Backups
Backups should be made periodically, so it is best to automate the backup process.
Linux/UNIX:
In Linux/UNIX the backups can be scheduled as a cron job. For example, to
automatically backup ProcessMaker every 12 hours, the following lines could be
added to the /etc/crontab file:
* */12 * * * root mysqldump -u root -pP@ssW0rD -F -x -A | gzip -c > /root/backups/pm_db_`date +%F_%H-%M
* */12 * * * root tar -czf /root/backups/pm_shared_`date +%F_%H-%M`.tar.gz
* */23 * * * root tmpwatch 720 /root/backups
The first command backups all the MySQL databases and compresses them with gzip
(http://www.gzip.org/) before saving them to a file named pm_db_DATE_TIME.sql.gz. The
current date and time is automatically inserted into the filename with the date
command, such as pm_db_2011-03-21_12-01.sql.gz Make sure to use `` (backticks), so
Linux/UNIX will execute the date command, rather than treating it like a quoted
string.
The second command backups up the ProcessMaker shared directory to file with the
current date and time in the filename, such as pm_shared_2011-03-21_12-01.tar.gz
Finally, every night at midnight, the third command automatically deletes any files
older than 30 days (30days x 24hours = 720hours) in the /root/backups/ directory, so
old backup files will not occupy too much space. If on a Debian or Ubuntu server,
use the tmpreaper command instead of tmpwatch.
Windows:
The open source 7-Zip compression program has a command line version named
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
13 of 16 06/25/2014 03:57 PM
7za, which can be run as a Windows Scheduled Task to make backups of the shared
directory. Create the new directory c:\Program Files\7za. Then [Downloaded 7az] and
decompress its files in that new directory, so it can be used.
Then, go to Start > All Programs > Accessories > System Tools > Task Scheduler.
In the "Task Scheduler" dialog box, click on Create Task. In the "Create Task" dialog
box that appears, go to the General tab and enter a Name and Description.
Then go to the Triggers tab and click on the New button. For the Begin the Task:
dropdown box, select "On a schedule". Under Settings select the Daily option. For
Start, enter the date and hour when the backups should start and enter a number
for how many days it should recur, then click on OK.
Back in the "Create Task" dialog box, go to the Actions tab and click on the New
button. For the Action dropdown box, select "Start a program". In the
Program/Script box, enter:
c:\Program Files\7za.exe
In the Add Arguments (0ptional) box, enter:
-aoa a "c:\Users\USERNAME\backups\pm_shared.7z" "c:\Program Files\ProcessMaker
\processmaker\shared"
Then, click on the "OK" button.
Next create a second action to backup the MySQL databases. Back in the "Create
Task" dialog box, go to the Actions tab and click on the New button. For the Action
dropdown box, select "Start a program". In the Program/Script box, enter:
c:\Program Files\ProcessMaker\mysql\bin\mysqldump.exe
In the Add Arguments (0ptional) box, enter:
-u root -pP@ssW0rD -F -x -A > "c:\Users\USERNAME\backups\pm_db.sql"
Then, click on the OK button twice to finish defining the Windows Scheduled Task.
Restoring ProcessMaker
It is not recommended to use data from one version of ProcessMaker with a different
version of ProcessMaker. Reinstall the same version of ProcessMaker which you were
using previously.
If you want to use upgrade ProcessMaker to a newer version, first install the old version
of ProcessMaker and then restore the data from your workspaces in the old version.
Then, upgrade ProcessMaker to the newer version.
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
14 of 16 06/25/2014 03:57 PM
To restore the files in ProcessMaker's shared directory, simply delete the existing files
and then decompress the backup file in its place.
Linux/UNIX:
In Linux/UNIX, the files can be restored from the command line:
rm -fr /opt/processmaker/shared
tar -xzf /root/backups/pm_shared_2011-03-21_12-01.tar.gz
Then, decompress the gzipped database backup file and use it restore the MySQL
databases:
gzip pm_db_2011-03-21_12-01.sql.gz
mysql -u root -p < /root/backups/pm_db_2011-03-21_12-01.sql
If restoring to a different installation of MySQL it is necessary to recreate the 3
MySQL users for the 3 databases for each workspace and give them permissions to
access their databases. If a backup was made of the mysql database, this can easily be
done:
mysql -u root -p < mysql.sql
However, this will overwrite the existing configuration and users of the MySQL
installation. If this is not desired, then it is probably best to manually create the
users, with their same passwords and permissions, which can be found in the file
<INSTALL-DIRECTORY>/shared/sites/<WORKSPACE>/db.php
Windows:
Delete the existing contents of the processmaker\shared\ directory. Then use 7-zip or
WinRAR to decompress the backuped archive into its place.
To restore the MySQL databases, navigate to the mysql\bin directory and import the
.sql backup file:
cd "c:\Program Files\ProcessMaker\mysql\bin"
mysql -u root -p < "c:\Users\USERNAME\backups\pm_db.sql"
Retrieved from "http://wiki.processmaker.com/index.php?title=2.0
/Backing_up_and_Restoring_ProcessMaker&oldid=34503"
This page was last modified on 17 April 2014, at 18:18.
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
15 of 16 06/25/2014 03:57 PM
2.0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backing...
16 of 16 06/25/2014 03:57 PM