Change Database connection settings

I am using Version: 2.0.11, there is some customizations made. I would like to upgrade to the latest version, but before I do that I would like to try upgrading on a test site first to make sure the upgrade will not break anything serious.

I have duplicated the live database to a new database (as the testing database). I have also copied the website files into a new folder. Now, how do I change the database connection settings for my testing site to connect to the testing database?

In the root directory of your CS cart installation there is a file config.local.php with the settings as follows:


  • Database connection options


    $config['db_host'] = '

    $config['db_name'] = '

    $config['db_user'] = '

    $config['db_password'] = '*******************';

    $config['db_type'] = '

Yes, this works prefectly! I am now doing the upgrading of the software.

I have successfully upgraded from an earlier version to 2.0.11. But when I proceeded to upgrade from 2.0.11 to 2.0.12, seems like the process can't proceed successfully or timed out. It keep running for quite a while at “admin.php?dispatch[upgrade_center.run_backup]=Continue”, then it just stopped… was the script timed out? How should I resolve this?

Thank you.

Check your permissions for the var/database/backup directory - when you copied the files the directory permissions may have been reset. They should be 777 for /images /skins and /var.


I checked the folders.

[root]/var/database/backup - 755

[root]/skins - 755

[root]/var - 755

but I do not have /images because I didn't copy images over into the testing site. Because there are too many images, and for the testing site, I can do without the images.

Please advise?

Thank you.

I wouldn't know - but I would try permissions 777 for those directories to see if the upgrade gets any further and perhaps put the /images directory where it should be with 777 permissions and some of the images - it does the backup before it starts the upgrade so the fact that it has failed at the backup stage you want to make sure your test site is configured the same as the live one so you can see if the upgrade was successful (with as much the same as the live store as you can). If it then doesn't work you will probably need CS Cart's support to do the upgrade (or you could keep your backup for your current version - check it works - and try upgrading the live store).

Actually my database is huge. I can't even export my database in PhpMyAdmin… it will just time out after a while. I tried this a few times, and it always timed out. Could this be the reason that causes the upgrade to halt?

I can't use the test site as the backup because the database for the test site was created by my hosting provider (I asked them to create this testing database from the live database because in PhpMyAdmin it timed out) a few days ago (ie outdated).

Have you tried the database backup from within CS Cart (go to Admin - Database - Backup tab)? If this fails then you have identified the problem as CS Cart needs to do the backup before upgrading the database. If it does work you can copy the backup file to the same place on your backup installation and restore the database using the Admin - Database - Restore tab. This way you will have a fully up to date database.

To do the upgrade on a live store you will need to click “close storefront” in the bottom right corner of admin panel before doing the backup to be sure you have an up to date copy and no orders are lost during the upgrade.

Another thing to do is to clear the logs - if these are enabled they will be storing a massive amount of data in the database - go to Admin - Logs and click the link “clean logs”. You can then optimize the database in Admin - Database - Maintenance tab. After doing all that and it still won't backup - let us know the size of your database and someone will probably know if it is a size problem and what to do (you may have to increase your memory limit) or if it is likely to be something else.