Upgrading via Command Line


I’m trying to update Cs-cart via Command Line Cs-cart CS-Cart 4.14.3.SP1 B2B

php admin.php --dispatch=upgrade_center.console upgrade

and I get a message like this
[Access denied] You must log in before you can access this resource!

any idea how to solve this?


I have the correct permissions,

when I move upgrade_center.php to the frontend folder its working correctly


php index.php --dispatch=upgrade_center.console upgrade


If the root administrator is missing or has an ID other than 1 in the database of your shop, interaction with the console may end with this error in versions older than 4.15.1. This issue was fixed in 4.15.1. You can apply a hotfix in your installation by replacing the code:

        $user_id = fn_get_session_data($area . '_user_id');

        if (defined('CONSOLE') && SiteArea::isAdmin($area)) {
            $user_id = 1;


        $user_id = fn_get_session_data($area . '_user_id');

        if (defined('CONSOLE') && SiteArea::isAdmin($area)) {
            $user_id = db_get_field('SELECT user_id FROM ?:users WHERE user_type = ?s AND is_root = ?s AND company_id = ?i', 'A', 'Y', 0);

in the app/functions/fn.init.php file.

you’re the best, yes that’s it big thanks

root user id has changed during many years form 1 to other

1 Like