How to Upgrade Elgg from 1.7 to 1.8

Hii,

I'm new to elgg. As of now, we are maintaining a site with Elgg 1.7.19. But now, we want to upgrade it to 1.8.20. What i have to do for that??

I have downloaded elgg 1.8.20 and replaced actions, engine and mod folders in 1.7.19 which i'm using now. What else the things i have to do now?

  • First, make a backup of your elgg network and database as well.

    Then, upgrade from the latest version of elgg 1.7 to elgg 1.8, keeping in mind that you must remove some folders.

    And you can get more info in http://learn.elgg.org about the upgrade process.

    Did you face any problem upgrading?

  • Thanks RJ,

    Until now i didn't face any problem in upgrading. I'm just reading the docs to know what to do for upgrade. Is there any changes which i have to do in code for upgrading?

  • In addition to what is said at http://learn.elgg.org/en/1.10/admin/upgrading.html about upgrading from 1.7 to 1.8 I would suggest to run the following script while your site is still on 1.7:

    <?php
    /**
     * Elgg 1.8-svn upgrade 2011031600
     * datalist_grows_up
     *
     * Ups the varchar to 256 for the datalist and config table.
     *
     * Keeping it as a varchar because of the trailing whitespace trimming it apparently does:
     * http://dev.mysql.com/doc/refman/5.0/en/char.html
     */

    require 'engine/start.php';

    $db_prefix = elgg_get_config('dbprefix');

    $q = "ALTER TABLE {$db_prefix}datalists CHANGE name name VARCHAR(255)";
    update_data($q);

    $q = "ALTER TABLE {$db_prefix}config CHANGE name name VARCHAR(255)";
    update_data($q);

    echo "Done";

    Save this code in a file for example named "datalist_grow_up.php" in the root folder of your Elgg installation and then execute it while logged in as admin by calling "http://your_site.url/datalist_grow_up.php&quot;.

    This upgrade script is actually part of the upgrade process from 1.7 to 1.8 anyway (engine/lib/upgrades/2011031600-1.8_svn-datalist_grows_up-0b8aec5a55cc1e1c.php). The problem is that it fails to work as intended (at least for me all the time) when it's executed during the normal upgrade process of Elgg 1.8 resulting in the upgrade to get stuck (see https://github.com/Elgg/Elgg/issues/6814).

  • Thanks iionly,

    I have one more question. Other than the Elgg core plugins i also have some custom plugins which i used to develop my site. And i had noticed that there are so many name changes for the functions. For example, get_metadata() have been changed to elgg_get_metadata(). Shall i have to change in every place which i used these kind of functions for developing my custom plugins?

  • If you want your plugins to function properly, then yes.

  • To check deprecated functions and more code issues I suggest you this plugin https://community.elgg.org/plugins/1213751

  • Javier,

    I have downloaded that plugin and placed it in my root folder and activated that in my site. Can you please tell me what i have to do to check the deprecated functions and code issues by using this.

  • That plugin can only be usable in 1.8+ so it won't do much if you haven't upgraded yet. It would be best to do a test upgrade on your computer or on a testing server.

  • @Krishna once you have moved your plugins to an Elgg 1.8 installation (as @Cim sais a testing installation), you must go to the admin panel, select Code diagnostic menu and enter your mod directory (usually mod/), or a specific plugin path (mod/your_custom_plugin/).

    Set all other options according to your preferences and press Go. You will obtain a report of all deprecated functions you must update.   

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking