2.0-backing up and restoring processmaker

Upload: abusalma

Post on 02-Jun-2018

234 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    1/16

    2.0/Backing up and RestoringProcessMaker

    Tweet Bagikan 0

    From ProcessMaker

    Contents

    1 Backing up Workspaces1.1 Backing up Bigger Workspaces

    1.2 Backing up Multiple Workspaces

    1.3 Automating Backups1.3.1 Linux/UNIX1.3.1.1 Inserting Date/Time in Filenames

    1.3.1.2 Storing Backups Remotely1.3.2 Windows

    1.3.2.1 Inserting Date/Time in Filenames1.3.2.2 Storing Backups Remotely

    2 Restoring Workspaces2.1 Importing Workspaces from ProcessMaker 1.X into 2.X

    2.2 Importing Workspaces into newer versions of 2.X3 Manual Backup and Restore

    3.1 Automating Backups3.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 safeguardthe data being stored in ProcessMaker. If periodic backups aren't being made, onelightning strike or an accidental deletion of key files on your system could bring yourorganization to a grinding halt. Backups can also be very useful for returning to aprevious 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 operatingsystem needs to be restored. For the data stored in ProcessMaker, it is recommended toperiodically backup your workspaces. Depending on how critical your data is and howoften it is being updated, a daily backup or a weekly backup would be appropriate.

    ShareShare

    .0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backi

    of 16 06/25/2014 03:57

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    2/16

    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 tarfile 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 thewf_workflow, rb_workflow, and rp_workflowdatabases and stores

    its files in the shared/sites/workflow/directory.

    To backup a workspace, open a command line prompt in the server runningProcessMaker.

    Hint:If unable to find the command line prompt, in Windows, go to Start > AllPrograms > Accessories > Command Prompt. If using a GNOME-based Linux/UNIXsystem, in the main menu, go to Accessories > Terminal.

    Note for Linux/UNIX:If the shareddirectory has been set to 770 permissions for

    security reasons, then login as "root" or sudo when backing up a workspace. Anotheroption 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 thatuser 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:

    .0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backi

    of 16 06/25/2014 03:57

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    3/16

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    4/16

    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 beingbacked 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 SavedDump 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

    .0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backi

    4 of 16 06/25/2014 03:57

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    5/16

    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 SavedDump 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 SavedUNLOCK 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 SavedDump 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

    .0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backi

    of 16 06/25/2014 03:57

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    6/16

    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

    pmosCommunityprocessTemplate

    Workspace Nameworkflow

    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

    vailable version:From 2.5

    Sometimes, the backup is too big to be handled in some OS configurations. To solve thisissue a new parameter -swas 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 [] WORKSPACE[BACKUP-FILE]

    Where:

    megabyte_max_files_size:parameter to specify the size, in parts, file will becompress, for instance if it is a file of 2 GB to backup, this parameter may bedefined with 1024, it means the it wilb be compress in two parts of 1024 MB.

    If -sparameter 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

    .0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backi

    of 16 06/25/2014 03:57

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    7/16

    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 cronjob. For more information on the

    format of the crontabfile, see Configuring crontabin Linux/UNIX.

    For example, the following line could be added to the /etc/crontabfile to automaticallybackup 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-restorecommand to roll the workspace back toa state which is older than 12 hours. For example, if a database gets corrupted 3 daysago, the backup file will have already been overwritten, so it isn't possible to recoverthe old database. Therefore, it is recommended to use a time stamp in the backup filename, so multiple backup files can be maintained. However, old backup files also needto be periodically eliminated so that the backups don't eat up all the harddrive space onthe server.

    These cron jobs could be used to make a backup file every 12 hours and save it to a fileat /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/

    * */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

    .0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backi

    of 16 06/25/2014 03:57

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    8/16

    Linux/UNIX will execute the datecommand, rather than treating it like a quoted string.

    The second command automatically deletes any files older than 30 days (30days x24hours = 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 thetmpreaper(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 alsodestroy 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.tgzip/root/backups/workflow_$CURDATE.tarscp/root/backups/workflow_$CURDATE.tar.gz [email protected]:/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 apublic/private key with the command:

    ssh-keygen -t rsa

    Add the public key to the /root/.ssh/authorized_keysfile in the backups.example.com

    server. For more information, see this article (http://www.linuxjournal.com/article/8600) . Then, add the pmbackup.shscript as a cronjob 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

    .0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backi

    of 16 06/25/2014 03:57

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    9/16

    periodically executes the processmaker workspace-backupcommand. For more information

    on using the SCHTASKScommand, see Executing cron.phpwith the SCHTASKScommand.

    Examples:

    1.Backup the default "workflow" workspace every day at midnight and 1pm (during

    the lunch break) on a ProcessMaker server installed atC:\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-bac

    2.Backup the "sales" workspace to the file C:\Documents and Settings\Bob\Backups\sales

    workspace.tarevery 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

    Notice how paths and file names which contain spaces are enclosed inside singlequotation marks.

    3.Backup the "sales" workspace to the file SalesBackup.taron 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-bac

    Inserting Date/Time in Filenames

    It is not possible to insert the current date and time in the backup filename using thesystem %date%and %time%variables, since SCHTASKStreats them as literal strings. Instead,

    create a .batfile to execute the processmaker workspace-backupcommand. For example, the

    file C:\Users\Bob\pmbackup.batcontains:

    C:\Users\Bob\AppData\Roaming\ProcessMaker-2_0_30\processmaker\processmaker workflow-backup

    Then, use the SCHTASKScommand to schedule the periodic execution of the C:\Users

    \Bob\pmbackup.batfile:

    SCHTASKS /Create /U administrator /P p4s5w0rd /SC DAILY /ST 00:00,13:00 /TR "C:\Users\Bob\

    .0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backi

    of 16 06/25/2014 03:57

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    10/16

    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.batfile to execute the processmaker workspace-backupcommand and use pscpto copy the

    backup file to a remote server.

    For example, the file C:\Documents and Settings\Bob\pmbackup.batcontains the following

    code to copy the backup file to the /root/backupsdirectory 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\proces

    Then, use the SCHTASKScommand to schedule the periodic execution of the C:\Documents

    and Settings\Bob\pmbackup.batfile:

    SCHTASKS /Create /U administrator /P p4s5w0rd /SC DAILY /ST 00:00 /TR "Documents and Settin

    To copy the backup files to a remote Windows server, install an SSH server on theremote Windows server (with programs such as freeSSHd (http://www.freesshd.com) ,CygWin (http://www.cygwin.com) or WinSSHD (http://www.bitvise.com/winsshd) ), so itcan 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 wasadded from version2.5.2.

    For example, to restore from the shared/backups/workflow.tarbackup file in Linux/UNIX:

    .0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backi

    0 of 16 06/25/2014 03:57

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    11/16

    ./processmaker workspace-restore workflow

    If the backup file is not located in the shared/backupsdirectory or it doesn't have an

    extension of ".tar", then specify the path. Remember to enclose it within double quotesif 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 samedatabases names as the original. To overwrite an existing workspace, use the -oor

    --overwriteoption. 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 WORKSPACEparameter. 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 orother special characters. To avoid problems, it is recommended to only use ASCII letters,numbers and underscores "_" for workspace names, since the workspace name shouldbe easy to represent in a web address. Remember that workspace names are casesensitive when being entered in a URL in a web browser, but MySQL databases inWindows are not case sensitive, whereas MySQL databases in Linux/UNIX are casesensitive.

    For example, to import the backup file at "shared/backups/workflow.tar" with theworkspace name of "finance":

    ./processmaker workspace-restore -o workflow finance

    To only show information about a backup file, use the -ioption. For example, to show

    information about the workspace(s) in the sales.tarbackup file:

    ./processmaker workspace-restore -i sales

    To restore a workspace from a backup file which has multiple workspaces, use the -wor

    --workspace=option to specify which workspace should be restored. For example, to

    restore the "Finance" workspace from the file pmBackup.tarand overwrite the existing

    "accounting" workspace:

    .0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backi

    1 of 16 06/25/2014 03:57

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    12/16

    ./processmaker workspace-restore -o --workspace=finance pmBackup finance

    or:

    ./processmaker workspace-restore -o pmBackup finance

    For help using the processmaker workspace-restorecommand:

    processmaker help workspace-restore

    To restore workspaces with more than 2 GB in size run the following command:

    ./processmaker workspace-restore -m

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    13/16

    If importing a workspace which was created in an older version of ProcessMaker 2.Xinto a newer version of ProcessMaker 2.X, then use the processmaker workspace-restore

    command. Afterwards, update the database tables and workspace files to the newversion, by changing to the INSTALL-DIRECTORYand 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 cronjob. For example, to

    automatically backup ProcessMaker every 12 hours, the following lines could beadded to the /etc/crontabfile:

    * */12 * * * root mysqldump -u root -pP@ssW0rD -F -x -A | gzip -c > /root/backups/pm_d

    * */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.gzMake sure to use `` (backticks), so

    Linux/UNIX will execute the datecommand, rather than treating it like a quoted

    string.

    The second command backups up the ProcessMaker shareddirectory 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, soold backup files will not occupy too much space. If on a Debian or Ubuntu server,use the tmpreapercommand instead of tmpwatch.

    Windows:

    The open source 7-Zip compression program has a command line version named

    .0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backi

    3 of 16 06/25/2014 03:57

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    14/16

    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 Generaltab and enter a Nameand Description.

    Then go to the Triggerstab and click on the Newbutton. For the Begin the Task:dropdown box, select "On a schedule". Under Settingsselect the Dailyoption. ForStart, enter the date and hour when the backups should start and enter a numberfor how many days it should recur, then click on OK.

    Back in the "Create Task" dialog box, go to the Actionstab and click on the Newbutton. For the Actiondropdown box, select "Start a program". In theProgram/Scriptbox, 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 actionto backup the MySQL databases. Back in the "CreateTask" dialog box, go to the Actionstab and click on the Newbutton. For the Actiondropdown box, select "Start a program". In the Program/Scriptbox, 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 OKbutton twice to finish defining the Windows Scheduled Task.

    Restoring ProcessMaker

    It is not recommended to use data from one version of ProcessMaker with a differentversion of ProcessMaker. Reinstall the same version of ProcessMaker which you wereusing previously.

    If you want to use upgrade ProcessMaker to a newer version, first install the old versionof ProcessMaker and then restore the data from your workspaces in the old version.Then, upgrade ProcessMaker to the newer version.

    .0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backi

    4 of 16 06/25/2014 03:57

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    15/16

    To restore the files in ProcessMaker's shareddirectory, 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 MySQLdatabases:

    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 3MySQL users for the 3 databases for each workspace and give them permissions toaccess their databases. If a backup was made of the mysqldatabase, this can easily be

    done:

    mysql -u root -p < mysql.sql

    However, this will overwrite the existing configuration and users of the MySQLinstallation. If this is not desired, then it is probably best to manually create theusers, with their same passwords and permissions, which can be found in the file

    /shared/sites//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\bindirectory and import the

    .sqlbackup 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.

    .0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backi

    5 of 16 06/25/2014 03:57

  • 8/11/2019 2.0-Backing Up and Restoring ProcessMaker

    16/16

    .0/Backing up and Restoring ProcessMaker - Proces... http://wiki.processmaker.com/index.php/2.0/Backi

    6 of 16 06/25/2014 03:57