Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

How to upgrade from mid 2011

FBC-Tim
Posts: 25
Joined: Thu Jun 23, 2011 6:08 am

How to upgrade from mid 2011

Unread post by FBC-Tim »

Hi.
I have a nuBuilder application that was written back in July 2011 and I have not done any work on it since. Some changes now need to be made and I would like to use some of the new nuBuilder features you have implemented. I see there are a number of Schema Changes to load since then. How can I determine which build number my current application is using? Do I just load each schema update from that point one at a time and dump the files from the latest download into the productionnu2 directory? My apologies if there is an FAQ covering this already, I could not find it.
Tim
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: How to upgrade from mid 2011

Unread post by admin »

Tim,

It should be as simple as installing the schema changes from the date you last upgraded any changes.

(I would take a backup first just in case something doesn't work)

You will find (if it all goes smoothly) you will need to change some colors, as the browse colors are set to blue.

http://www.nubuilder.com/change.php

Run all the Schema Changes (in the blue textatea) for each version, starting with the oldest version you think you need.

http://wiki.nubuilder.com/tiki-index.ph ... structure=

will give you an idea of the things that have changed.

Steven
FBC-Tim
Posts: 25
Joined: Thu Jun 23, 2011 6:08 am

Re: How to upgrade from mid 2011

Unread post by FBC-Tim »

Thanks for the info Steven, I will carefully follow this process.
But I need to know where to start. Is there a field in the database I can look at to see what build I am currently running to get my starting point?
LAS0
Posts: 2
Joined: Tue Feb 07, 2012 4:50 pm
Location: Europe

Re: How to upgrade from mid 2011

Unread post by LAS0 »

In relation to this - How to perform an update in general? (I was not able to find easy step-by-step guide.) Is this right procedure (for windows)?
1. Download a new build of the nuBuilder from the website.
2. Install/uncompress (and overwrite) ONLY data to folder /productionnu2 (???)
3. What about files in folder /db (and in subfolder with my "projects")?
4. Where, when and how (If so) I should run SQL from ChangeLog site?
Thanks
LS
FBC-Tim
Posts: 25
Joined: Thu Jun 23, 2011 6:08 am

Re: How to upgrade from mid 2011

Unread post by FBC-Tim »

Good questions LASO. I would like to see these answers too please. Bump. :arrow:
danielf
Posts: 44
Joined: Tue Jul 26, 2011 2:48 pm

Re: How to upgrade from mid 2011

Unread post by danielf »

Hi, I'm in the same boat, and a little stumped as well.

With regards to Laso's question 4: I presume that you run the change code fron the SQL window in phpmyadmin when logged on to the data base for the site you're upgrading?

Also: I'm struggling to add a site to the nuBuilder directory. Previously, I've just modified the sample site, but now I'm looking to add a new one. So I've copied the sample directory in the db folder, changed the site name in config.php, and created a new data base with user and password in phpmyadmin. I can't however get the site to display in 127.0.0.1, and if I go to http://127.0.0.1/db/mysite, it says 'can't find the requested url'. Any thoughts on what I'm doing wrong? Sorry, if I sound daft, but I can't find any easy instructions on how to create a new site anywhere.





Oh. just to add: trying to update the schemas from phpmyadmin, I get an error with the last two updates (2.5 and 12.01.09). I'm getting the following error:

#1054 - Unknown column 'sob_lookup_autocomplete' in 'field list'

I'm attempting to upgrade from 11.03.22 to 12.02.15.
pickle_jimmy
Posts: 38
Joined: Mon Jul 25, 2011 4:00 am

Re: How to upgrade from mid 2011

Unread post by pickle_jimmy »

Hi All,

Ok, let me try to answer the Update question in as generic and most useful way I can...

First: NuBuilder is made up of 3 components.
1) The nuBuilder PHP files - generally found in the webroot/productionnu2 directory
2) The zz tables in the database - which contain the structure of your nuBuilder site
3) Your database tables - which contain your data

To upgrade the version of nuBuilder you are using, you want to get the new PHP files, and the changes to the zz tables without losing your data.

************ WARNING ************** ************ WARNING ************** ************ WARNING **************
You should NEVER try upgrading without backing up ALL of the above - your database, AND the PHP files.
Just in case you need to roll back.
************ WARNING ************** ************ WARNING ************** ************ WARNING **************

To upgrade the PHP files is easy: download the latest .zip package; extract it; overwrite the files in your productionnu2 directory with the ones in the extracted version.
This will probably break nubuilder, as the PHP files may refer to items in the zz tables that dont exist.

We then need to go through the SQL statements in the change log and run them one at a time to make the required changes to the zz tables. These SQL statements may add lines to tables, or alter the table structure to include new fields.

The two questions that come up when running the SQL are: Where do I start, and What happens if there is an error.

1) Where do I start? This is both difficult and easy to answer - difficult, because it depends on what version you have - easy, because it is not critical as long as you are happy to handle the odd error that comes up... which leads us to question 2.

2) What happens if there is an error? The hardest part about writing the SQL in the change log is that for many changes there is not an easy way to check if the change needs to be, or even can be made.
eg:
Sometimes a table needs to be altered to add a field - but the field might already be there.
Sometimes a line might need to be added to a table, but all the fields that are being populated need to exist first.

So, to the very general advice.
Start earlier in the change log than you think you need to - to ensure you don't miss some critical change.
When an error occurs:
If it is an INSERT error
- it is because the data already existed and it would have duplicated a primary key; so you can either ignore the insert, or DROP the row and try the insert again.
Dropping and re-inserting ensures that if the data is changed, the changes will be added.
- or, there is a table schema issue - a field doesn't yet exist. In this case, you can either find where this is added in the change log, or manually add it.*

If it is an ALTER error
- it is generally because the alteration has already happened.
Check the SQL to make sure what it is trying to accomplish has been done. Eg, the added field exists in the table.

* you can always load the sample database in the .zip package into a temporary database to ensure any manual schema changes you make match the required schema.

Hope this helps

Cheers

PJ
pickle_jimmy
Posts: 38
Joined: Mon Jul 25, 2011 4:00 am

Re: How to upgrade from mid 2011

Unread post by pickle_jimmy »

CREATING A NEW SITE
===================

I noticed a question regarding the creation of a new site, hope this helps.

I want a new site called mysite (http://127.0.0.1/db/mysite)

1) All your sites can use the same base PHP code, contained in the webroot/productionnu2 directory
2) To create a new starting directory, copy the webroot/db/sample dir to webroot/db/mysite
2a) edit the mysite/config.php - change the DBName (eg mysite), DBUser, and DBPassword to reflect the database you are about to create in PHPMyadmin
2b) edit the mysite/index.php - change dbfolder from "sample" to "mysite". You may also want to change the nameText
3) In PHPMyadmin, select the sample database, go to "OPERATIONS" and copy the database to a new database (eg mysite) - this is **critical** - nuBuilder cant start from a blank database, it needs its zz tables.
3a) You now either need to add a new user/password in PHPMyadmin and assign them permissions to this new database, or use the existing sample user, and assign it permissions. This user/pass combo needs to match what ever is in the config.php file

Cheers

PJ
danielf
Posts: 44
Joined: Tue Jul 26, 2011 2:48 pm

Re: How to upgrade from mid 2011

Unread post by danielf »

I can't vouch for correctness (yet), but pickle_jimmy deserves a trophy for effort at the very least. :D

Regarding the error code I got: I uninstalled nubuilder, then installed the last build, and then imported the site/data base from the old install (which is kept on a different machine). Next I tried to apply the upgrades to the data base/site. It seems to me the problem I'm having is with the zzsys tables in my site, rather than the php aspect of nubuilder, but I may be wrong of course.
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: How to upgrade from mid 2011

Unread post by admin »

Danielf,

Read what pickle_jimmy said about SQL
pickle_jimmy wrote:We then need to go through the SQL statement...
(He's a legend)

Steven
Locked