Forums | Mahara Community

Support /
Upgrading a clone with errors!


Philipp Witte's profile picture
Posts: 1

09 August 2016, 18:33

Hello Guys,

 

I got a problem while an upgrade of a clone of a live system of mahara.

 

At first my starting point:

 

At work i got a live system with a mahara installation at the version 1.8.1. Now my boss told me to built a test area to see if the upgrade works properly. So i set up a CentOS 7 with Paralleles on my Mac. Easy till now. I copied the data of the mahara installation out of the www-root of the live version and created a SQL dump of the database.

After i installed the requirements for mahara on CentOS 7 i copied the data of the installation into the www-root of the virtual machine and imported the sql dump into the MariaDB. The Database and the database user are the same as on the live version. I also copied our "alumni_data" folder to the clone. After that i checked the config.ini to get the clone run well with the version 1.8.1.

 

What i have done till yet?

i looked up for some instructions for upgrading mahara. I found the upgrade-wiki and followed the steps on there. copied the new data to the www-root and so on. then i stucked on the upgrade.php and the secreturl. I edited the config.ini with a secreturl and put the secret at the end of the browser-url ( like upgrade.php?secreturl=passphrase ). Here i stuck. I cant see the upgrade window at the browser. Just a page where the site told me that the site ist closed and ready for a database upgrade, I clicked on the upgrade link, that get me to the same page again. The login as admin doenst work too.

After a while of searching at the web i found a solution which worked for a couple of people. They commented the proof of the secreturl out in the upgrade.php. Like:

// Check if we have come via browser and have the right urlsecret
//if (php_sapi_name() != 'cli' && get_config('urlsecret') !== null) {
//    $urlsecret = param_alphanumext('urlsecret', -1);
//    if ($urlsecret !== get_config('urlsecret')) {
//        die_info(get_string('accessdeniednourlsecret', 'error'));
//    }
//}

 

This helped me too. Now i see the Upgrade windows at the browser. But now i got errors while the upgrade is running.

This 3 errors are coming:

 

  Could not execute command: UPDATE "mahara_site_content" SET institution = ?
Call stack (most recent first):
  • execute_sql("UPDATE {site_content} SET institution = ?", array(size 1)) at /var/www/html/lib/db/upgrade.php:2970
  • xmldb_core_upgrade("2013101405") at /var/www/html/lib/upgrade.php:342
  • upgrade_core(object(stdClass)) at /var/www/html/admin/upgrade.json.php:87

 

The SQL user has full right to every database in there ( it is just this one ). As i said it is also the same user as the live version.

 

Is there any solution i passed to check?

 

~ Philipp ( Please forgive my english :x )

Aaron Wells's profile picture
Posts: 896

10 August 2016, 17:57

Hi Phillipp,

The "urlsecret" feature is there to prevent unauthorized users from running your site's cron or upgrade scripts, see: http://manual.mahara.org/en/16.04/administration/config_php.html#new-in-mahara-16-04-urlsecret-run-the-cron-or-upgrade-only-when-you-are-authorised

But, if you want to disable it, the easy way is to add this to your config.php file:

$cfg->urlsecret = null;

(Unfortunately there's a typo in the manual page right now that says to set it to "none" instead of "null".)

I don't know what's causing the SQL error you're seeing. That "Could not execute command" string comes from htdocs/lib/dml.php in the execute_sql() function, and just means that there was an error of some sort running the command. It is preceeded by a log_debug(), so you may see more details in your PHP error log file, or if you enable "$cfg->productionmode = false;" in your config.php file, then it should print that to the screen.

One thing to note is that MySQL permissions can be limited by the user's location. For instance, a user may be defined as 'ME@localhost', which means that user can only connect if they're on the same machine as the MySQL server. So if your clone site is on a different web server than the original site, that may be something to check. See http://dev.mysql.com/doc/refman/5.7/en/adding-users.html

Cheers

Aaron

2 results