iDempiere workspace snapshots

168 views
Skip to first unread message

Neil Gordon

unread,
Oct 14, 2014, 8:10:44 AM10/14/14
to idem...@googlegroups.com
I have found an invaluable "best practice" is to keep a snapshot (backup) of the iDempiere workspace.

If anything goes wrong, or the workspace seems to be behaving badly, then I backup my current workspace, and restore to a stable snapshot.

Just having this kind of backup, even if it is never used, enables one to try things one might not have considered doing,  for fear of causing problems.

One must just remember to update the snapshot, when things are stable, and especially after having made changes to the workspace.

A rule of thumb, is always to take a snapshot, before making any major changes.

I have found that when restoring the workspace, that it should be restored to exactly the same physical location, to work properly.

I am attaching a Linux script, which simplifies the process of taking a snapshot. It creates a tar archive with a date/time stamp, and optionally takes a parameter describing the snapshot. See the script itself for usage.

Windows users can use robocopy instead. Example:  robocopy "C\workspace\from" ""C\workspace\backup" /copyall /r:3 /w:1 /zb /e

-----
Neil Gordon
nTier Software Services
http://www.ntier.co.za

bk.tar.sh

Ricardo Malla

unread,
May 27, 2016, 2:12:59 PM5/27/16
to iDempiere
Hey Neil, 

I have a question. How to you do the Snapshot Backup? Do you just "tar" the /opt/idempiere/ folder??? What about the DB? Is it contained there or another backup need to be made?

Is there any documentation I can find that addresses the best practices to backup idempiere?

Thanks, 

Ricardo Malla 

Neil Gordon

unread,
May 30, 2016, 11:28:35 AM5/30/16
to iDempiere
Hi Ricardo,

> I have a question. How to you do the Snapshot Backup? Do you just "tar" the /opt/idempiere/ folder??? What about the DB? Is it contained there or another backup need to be made?

Yes, you can tar the files. However, you will also need to do a separate db backup. There is a script called RUN_DBExport.sh, but I haven't used it for a while. 

If you are working on Postgres, you can use the following script to backup:

pg_dump -Uadempiere $db > $file

Substitute the $ variables given above with your required parameters.

You can use the following script to restore the db:

dropdb  -U adempiere $dbname
createdb  -U adempiere -O adempiere $dbname
psql -d $dbname -U adempiere -f $db

I'm not sure about other documentation, regarding best practices. The above, together with a backup of the files, should be sufficient.

--
Neil Gordon

Ricardo Malla

unread,
May 30, 2016, 12:05:11 PM5/30/16
to iDempiere
Great Neil thanks, I already did it that way, backing up the Files System and the DB separately.

Thanks so much, 

Ricardo Malla

Alejandro Guerra

unread,
May 30, 2016, 1:11:59 PM5/30/16
to iDempiere
Hi, the script RUN_DBExport.sh and RUN_DBRestore.sh work fine!!!!

Ricardo Malla

unread,
May 30, 2016, 7:22:06 PM5/30/16
to iDempiere
Thanks Alejandro! Will do.

Neil Gordon

unread,
Jun 1, 2016, 8:24:14 AM6/1/16
to iDempiere
Just a correction to my original post:

> I have found that when restoring the workspace, that it should be restored to exactly the same physical location, to work properly.

You don't need to use the same physical location, if you use the ${workspace_loc} variable when specifying the location of the plugins for the target platform.

If you followed the tutorial on the iDempiere wiki, then you will have it setup correctly :-)
Reply all
Reply to author
Forward
0 new messages