It is currently Sun Feb 12, 2012 7:53 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Correct way to upgrade?
PostPosted: Sat Mar 06, 2010 2:45 am 
Offline

Joined: Sat Jan 16, 2010 2:59 am
Posts: 27
Location: Australia
I think I succesfully updated from 5.0.6 to 5.0.7 on Windows.

I backed up my database using pgAdminIII
I uninstalled OpenERP AllinOne 5.0.6
I installed OpenERP AllinOne5.0.7

I created a new database in pgAdmin, and restored the previous backup into it.

Then I started OpenERP client, and it worked.

HOWEVER, since things like workflows and views are actually stored in the database, if any of those things have been changed from 5.0.6 to 5.0.7, I would have overridden them when I did the restore, wouldn't I?

Is there a correct way to update?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 07, 2010 2:46 am 
Offline

Joined: Sat Jan 16, 2010 2:59 am
Posts: 27
Location: Australia
AARRGGGGGGG

Ok, so this is NOT the right way, and of course it is obvious when you think about it.

Now I am trying to simply setup a new 5.0.7 install, and install all the modules I was using in 5.0.6.

Then, I have used Navicat to empty all the tables that have been filled with default data, except ir_*, process_* and wkf*

Now, I am trying to copy the data only from the 5.0.6 backup into the 5.0.7 database, but I can't seem to do this with Navicat or pgAdmin, because of the constraints. But I don't want to drop the tables completely, because then it will restore the contraints from 5.0.6, and I don't know if any of the constraints might have changed between versions.

I just want some way insert rows into the database while temporarily disabling constraints. I've tried --disable-triggers on pg_dump, but that didn't help.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 07, 2010 8:37 am 
Offline

Joined: Sat Jan 16, 2010 2:59 am
Posts: 27
Location: Australia
Well, that was my weekend!

I can't even fully remember what I did, there were so many twists and turns.

Basically, I used pg_dump to create a Plain (text) script type backup of the old database, data only - but I excluded the tables wkf*, process* and ir_* (but I did include ir_property).

I created a new database in 5.0.7, and installed all the modules I had previously in 5.0.6 (even the ones I dont want to use anymore)

I used navicat to empty all the tables, except wkf*, process*, ir_* (except for ir_property)

Then I used pg_dump to create a schema-only backup of THAT new database. Then I used a text editor to split that file in half - the constraints are in the second half.

I created a new blank database in pgAdmin, and in PSQL ran that first-half script, which essentially creates all the tables, with no constraints.

THEN I restored (attempted) the data using PSQL, but found one anomaly - no more voucher_type colum in account_move. Anyway, I removed that and re-backed up the old 5.0.6 database, re-emptied the tables in the new database and did the restore again, and got all the data in finally.

Then I ran the second-half script of the schema backup, which created the constraints.

So now it *seems* to be a better migration, but I'm still concerned about:

no OID's on the rows of the tables.
What dependencies do I not know about? As you can tell, I basically merged the new wkf*, process* and ir_* tables from a clean 5.0.7 install with hybrid tables of everything else. The hybrid is that the schema of the tables is from the 5.0.7 install, but the data is from 5.0.6.

There are enough bugs in OpenERP, without me making new ones by using this strange process to migrate my data. Can anyone see any pitfalls?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 07, 2010 2:30 pm 
Offline

Joined: Fri Oct 21, 2005 12:40 pm
Posts: 170
Location: Turin, Italy
1. backup your db, from the OpenERP Client (file -> database -> backup)
2. install the new version of OpenERP
3. restore your db, from the OpenERP Client (file -> database -> restore)
4. run the migration, from the OpenERP Client (file -> database -> migrate database)
5. hope :)

This is, in theory, the best practice.
This works if you didn't installed too many addons, and if you didn't customize views and objects.

A more practical way is to install the new version of openerp, then migrate data from the old instance to a new one using tools like the server_migration addon or writing your own procedures using XMLRPC apis of OpenObject or with OOOR: http://tinyurl.com/yabnsxq

Btw, migrations from/to minor versions (ie: 5.0.6 -> 5.0.7) of OpenERP usally go smoothly.

Other migrations, like 4.x -> 5.x are often a pain in the *

_________________
Davide Corio
http://www.domsense.com - http://www.agilebg.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 08, 2010 1:10 pm 
Offline

Joined: Tue Mar 24, 2009 4:23 pm
Posts: 5
Hi Gavin,

Perhaps I don't understand well your process because you can use just the --update=all option when install the new version 5.07. I mean, if you use this way you don't need to create a new database and import the data from the old, don't you?

I tested this option updating from a 5.0.4 version and seems to be ok.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 09, 2010 2:29 am 
Offline

Joined: Wed Feb 16, 2005 12:26 pm
Posts: 2518
Location: Annecy & Toulon,France
yes, netstay is right :
stop the server
backup for security both database and code
replace the code
start openerp server with -u and -d (see --help for more)
check the log
test if it is ok

doing so you loose some customization recorded in the database, modified workflows, views, menus and translations, but I think this is not your point.

regards

_________________
openerp demo http://sisalp.fr/demo.html
free hosting http://sisalp.fr/openerp-serveur-gratuit.html


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 09, 2010 2:32 am 
Offline

Joined: Wed Feb 16, 2005 12:26 pm
Posts: 2518
Location: Annecy & Toulon,France
by the way, the all-in-one for windows approach is not appropriate for upgrade (and for production environment, imho). You should upgrade only OpenERP software, not postgres and other dependencies. Under windows, I cannot help.
regards

_________________
openerp demo http://sisalp.fr/demo.html
free hosting http://sisalp.fr/openerp-serveur-gratuit.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP