Welcome Guest, Not a member yet? Register   Sign In
Upgrading to 3 from... 1.7.1 :(
#1

Ok, long story short, at work, I built a fairly large app a few years (could it have been as far back as 5 years ago, I think?!?) with CodeIgniter 1.7.1. The project was abandoned and now they've asked me to revive it.

I'm looking at the documentation/user guide and I see no direct instructions to go 1.7.1 to 3.0. I see that there are incremental directions to jump from version to version with a number of steps in each... I'm hoping to find one all-inclusive guide, or at the very least, one to get me from 1.7.1 to 2.0, and another to go from 2.0 to 3.0, without having to follow each of the 13 individual documents to jump each incremental release.

Any advice would be fantastic.

Thanks in advance for any insight you can provide.
Reply
#2

I don't think you will be able to find something like that ... the way i will do it is to go true all the documentations to get a feel to what was changed .... use programs like Beyond Compare 4 to compare old CI code with new code and fix errors by errors Smile
Reply
#3

The following is a basic summary of the changes for each version, with most changes which occur in multiple versions moved down to the later change. For this reason, it is not a good idea to follow this to change to any version earlier than 2.2.1 or 3.0.

If anything is not clear, you should check the user guide for the upgrade in question (which is one of the reasons I linked each page of the upgrade guide next to the version). If I were performing this upgrade, I would probably want to take the more careful approach of going version to version.

If nothing is listed here for a particular version, it means all changes in that version are superseded by a later version (in most cases the update instructions were, to paraphrase: "Update your "system" folder and user guide").

Anyway, {insert 2 million legal disclaimers here if necessary}, here's the summary for upgrading from 1.7.1 to 3.0:

1.7.1 to 1.7.2 http://www.codeigniter.com/user_guide/in...e_172.html
- Remove header() from 404 error template (note that 404 error templates move to a new location/format in 3.0)

1.7.2 to 2.0.0 http://www.codeigniter.com/user_guide/in...e_200.html
- Adjust get_dir_file_info(): make the second parameter FALSE if you need a recursive result (in other words, to get, more or less, the result you would have received in a previous version of CI)
- Convert Plugins to Helpers:
   - Rename files from filename_pi.php to filename_helper.php
   - Move them to your helpers folder
   - Change all instances of $this->load->plugin('filename'); to $this->load->helper('filename');
- Data encrypted with the 1.7.2 Encrypt library must be migrated, the encode_from_legacy() method was added to help with this process. See http://www.codeigniter.com/user_guide/li...rom_legacy
- The compatibility helper has been removed (remove any attempts to load it)
- Update models and controllers which extend the CodeIgniter Model and Controller to extend CI_Model and CI_Controller, respectively.
- Update extended libraries to call parent::__construct(); instead of the PHP4-style constructors.
- Move any core extensions to application/core

2.0.0 to 2.0.1 http://www.codeigniter.com/user_guide/in...e_201.html
- Change empty form_open() calls to form_open('/'); or form_open(base_url()); if they are expected to submit to the default controller.

2.0.1 to 2.0.2 http://www.codeigniter.com/user_guide/in...e_202.html
- Remove loading calls for the Security library
- Move MY_Security to application/core
- Use security->get_csrf_hash() and security->get_csrf_token_name() in place of the properties csrf_token_name and csrf_hash

2.0.2 to 2.0.3 http://www.codeigniter.com/user_guide/in...e_203.html
- Change references to the EXT constant with ".php"
- Remove APPPATH.'third_party' from application/config/autoload.php

2.0.3 to 2.1.0 http://www.codeigniter.com/user_guide/in...e_210.html
- Replace application/config/user_agents.php (you may want to combine this with 3.0 upgrade)
- Update Sessions Database Tables (you may wish to combine this with 2.1.1 or even 3.0 upgrades):
   CREATE INDEX last_activity_idx ON ci_sessions(last_activity);
   ALTER TABLE ci_sessions MODIFY user_agent VARCHAR(120);

2.1.0 to 2.1.1 http://www.codeigniter.com/user_guide/in...e_211.html
- Replace application/config/mimes.php (you may want to combine this with 3.0 upgrade)
- Update your IP address fields in database tables (enlarge ip_address columns to 45 characters), including sessions:
   ALTER TABLE ci_sessions CHANGE ip_address ip_address varchar(45) default '0' NOT NULL
   (you may want to combine altering the sessions table with 3.0 upgrade)

2.1.1 to 2.1.2 http://www.codeigniter.com/user_guide/in...e_212.html
2.1.2 to 2.1.3 http://www.codeigniter.com/user_guide/in...e_213.html
2.1.3 to 2.1.4 http://www.codeigniter.com/user_guide/in...e_214.html

2.1.4 to 2.2.0 http://www.codeigniter.com/user_guide/in...e_220.html
- The Encrypt library requires the Mcrypt extension

2.2.0 to 2.2.1 http://www.codeigniter.com/user_guide/in...e_221.html

The following changes are included in most of the above version changes (but will only be mentioned in this summary here), but you may want to combine them with the 3.0 upgrade
- Update CodeIgniter files (replace all files in the "system" folder and replace your index.php file; any changes made to index.php will need to be migrated over to the new one)
- Confirm $system_path is set to application's system folder (in your updated index.php file)
- Update your user guide

2.2.1 to 3.0.0 http://www.codeigniter.com/user_guide/in...e_300.html
This one really should be followed directly from the user guide. I will not summarize it here.
Reply
#4

That's kind of what I figured. The good news is as I'm going through, I can see that at lot of the stuff I'm seeing as "changed" and things that need to be converted from version to version do not apply as I didn't use those components. I'm just more worried about if I do everything and something isn't working, tracking down the issue of which of the 13 versions (or possibly which _ones_ of the 13) killed it will be a treat.

Oh well, my fault.

Thanks!
Reply
#5

It looks like all the version of ci user guide has been posted. Great work
Reply




Theme © iAndrew 2016 - Forum software by © MyBB