
************************************
Init/Update Cerebro database utility
************************************

* Update - Is it safe?
-------------------
Update utility performs all actions on new separate database.
Of course, all data from current database will be transferred to new one.
On the last stage of updating process, your current database will be renamed without any touch.
In case of success, new DB will become the working DB.

You may remove old DB later. Also, you may discard any updates with simple restoring the name of the old DB)

Anyway, you would better backup your DB regularly

* What do I need?
-------------------
Python at least version 2.x is needed.
You should ensure that python-executable could be found through PATH environment var.
You may test python installation typyng 'python --version' command.

* What do I have to do?
-------------------
1. Tune config.py to reflect your environment (see below).
2. Exec update script

Be carefully on UNIX with file permissions.
The config and all other spripts must be readable and executable.

* Tune config.py
-------------------

If you did it before you may skip this section

Package contains config.py.example.
It contains inline help about parameters.

If it is first time, you will have to copy it to specific place:
	UNIX:     /etc/cerebro.db.update/config.py
	WIN: %APPDATA%/cerebro.db.update/config.py (%APPDATA% usually looks like C:\Users\<LOGIN>\AppData\Roaming)

In both cases, 'cerebro.db.update' sub-directory is needed.

You may need to change the 'config.py' to reflect your environment.

LINUX: Typycal problem with ROOT account is: 
 - You use Ident auth,
   config.py is placed in /etc/cerebro.db.update,
   sudo'ed user (e.g. 'postgres') can not open /etc/cerebro.db.update/config.py due to permission lack,
   You will see "ImportError: No module named config"


* Run UPDATE script
-------------------

NNIX: You should use terminal to be able inspect utility stdout.

Depends of your OS run 
> update.<cmd|sh> <memoria-x.y directory>
Yoy have to specify argument with desired to update version of Cerebro DB.

Inspect stdout. 
If error occurs you would fix it and restart update process without hesitate.
