Skip to main content

Schedule Backup using DBExport from Adempiere ERP in Windows OS


Scheduled Backup from Postgres using pgagent is possible , but the size of Backup file generated is very large compared to that generated from Adempiere using DbExport.bat.

Creating Backup from adempiere by scheduling running of RUN_DBExport.bat from adempiere periodicaly using windows task scheduler is a viable solution.

There are few bat files that need to be changed

* E:\Adempiere\utils\myDBcopy.bat
* E:\Adempiere\utils\RUN_DBExport.bat
* E:\Adempiere\utils\postgresql\DBExport.bat

In the above case  "E:\Adempiere\" is the path of Adempiere home where it was build. Make necessary changes as needed.

NB: The environment variables are to be set properly in "Computer>properties>Advanced System Settings>Advanced>Environment variables "so as to make the following steps work.

First file  to be changed is E:\Adempiere\utils\myDBcopy.bat

Here change
"set DATETIME=%date:~6,4%%date:~3,2%%date:~0,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%"

to

"set datetime=%date:~-4%_%date:~-7,2%_%date:~-10,2%_%time:~0,2%_%time:~3,2%_%time:~6,2%"

so as to get more refined backup file name.


Next file to be changed is  E:\Adempiere\utils\RUN_DBExport.bat
 
Here change "%ADEMPIERE_DB_PATH% " to "%ADEMPIERE_DB_HOME%" in :
"@call %ADEMPIERE_DB_PATH%\DBExport %ADEMPIERE_DB_USER% %ADEMPIERE_DB_PASSWORD%"

Next file to be changed is  E:\Adempiere\utils\postgresql\DBExport.bat

note : this step is necessary only if the backup has to be created in any drive other than system drive most probably C:\

As the command is : cd %ADEMPIERE_HOME%\Data and cd wont change drive in cmd, this can cause error. so just give the corresponding drive before the cd command as shown in the image below.



Scheduling the task:

Open windows task scheduler from Start > All Programs> Accessories> System Tools >Task Scheduler

Go to task Scheduler Library and create new task

Give the preffered name and proovide highest privilages to the task

Select trigger tab and select needed interval after which the backup has to be performed.
In the actions tab select new to select what has to be performed :

Here select start program from drop down and select the bat file to be run

untick all of the checkboxes in the conditions tab or manipulate as necessary

Thats it , Your adempiere backup has been scheduled.


To check it, run the task from the scheduler.  Enjoy :)












Popular posts from this blog

Tuning postgresql for better performance - ADempiere ERP

PostgreSQL is a highly customizable relational database management system (RDBMS) with a dazzling array of configuration options.   The postgresql.conf file is located in the \PostgreSQL\9.x\Data folder. You can tune the following sections of the postgresql.conf file to get the best performance.     CONNECTIONS AND AUTHENTICATION In this section change the following entries to the following: max_connections = 350 authentication_timeout = 7min RESOURCE USAGE (except WAL) In this section change the following entries to the following: shared_buffers = 256MB : PG Backends that need to access tables first look for needed blocks in this cache. If they are already there, they can continue processing right away. The change can be made with a   postmaster  command-line flag or by changing the value of   shared_buffers temp_buffers = 32MB max_prepared_transactions = 20 work_mem = 1024MB maintenance_work_mem = 1024MB QUERY TUNING effective_cache_size = 2048MB R

Installation of Adempiere ERP on Windows

              This installation instruction is intended for initial installations where the database, application server and client all run on the same machine. For more complex installations, see   Installation Steps . An installation can take as little as 15 or 20 minutes if you start with the required downloads and do everything correctly. Other alternatives you might want to investigate are the   Windows Installer   or VMWare/VirtualBox AVA packages. However, the following method will give you much more control over the installation including upgrades with the latest patches and scripts. Before you begin, download each of the following packages: §   Java SE Development Kit   - Get the latest from   http://java.sun.com/javase/downloads/index.jsp . You only need the   JDK   without JavaFX, EE or NetBeans bundles. §   Postgre SQL   - Get the latest Windows install from   http://www.postgresql.org/download/windows . §   ADempiere Latest Release   - Download the latest Ad

Send Email Through Adempiere ERP

Send Email Through Adempiere E-Mail Configuration in Adempiere Mail Server This will specify the mail server to use Default: mailserver.(domain portion of %{serverFQDN}) Example: smtp.gmail.com Admin Email Use the default administrative mail address and it can be overwritten on client level Default: adempiere@(domain portion of %{ serverFQDN}) Example: teksalahadempiere@gmail.com Mail User Here we specify user of the default mail account Default: adempiere Example: teksalahadempiere Mail Password The password of the default mail account Default: adempiere Example: ********** 1    2.     Configuring Email in the client window The Client Definition Tab defines a unique client Step 1 .Login as admin Step  2 . Go to Menu -> System Admin -> Client Rules -> Client. In tab client fill fields’ mail host, request email request user and request user password. Finally press Test Email Button