Best Practice In Upgrading A Cs-Cart Store

What is the best way to upgrade a cs-cart store ? Much has been written about the upgrade process but what if you have set up development store as a clone to your live store and what to do next if you already have made backups of this developement store.

Do you deactive the applied theme and go back to the default theme first or not ?

Just came up with an following error:

WarningThe upgrade package seems to be broken. Please refresh packages list and try to download it again

[attachment=11266:upgrade-center-broken.png]

upgrade-center-broken.png

Thanks to someone who encountered this same issue with V2 store I followed his example:

I finally find the way.
just change the var/upgrade folder to any name.
make upgrade folder
and chmod 777
go the upgrade center and click reflesh link
than click upgrade link
thats all

Not quite... still some issues here:

While I managed to now download the install package I come across another hurdle:

See screenshot:

upgrade-center-broken2.png

You did not mention whatever if this is happening on localhost or on liveserver

While upgrading 433 I had also problem with permissions, here is how I fixed it

http://forum.cs-cart.com/topic/42954-validation-issue-upgrade-433sp1-434-on-localhost/?view=findpost&p=238187

You did not mention whatever if this is happening on localhost or on liveserver

While upgrading 433 I had also problem with permissions, here is how I fixed it

http://forum.cs-cart.com/topic/42954-validation-issue-upgrade-433sp1-434-on-localhost/?view=findpost&p=238187

This is happening Darius on the live / production server as having put the developer store in a subdirectory fo the live production site.

Still would your solution still apply in my case ?

My fix is more windows OS related but you are on linux I suppose. Maybe files you gave permissions to 777 have incorrect user/group

I suppose easiest and fastest solution would be giving what you are asked, that is ftp access :)

Perhaps Darius but you also upgraded from V4.2 and I am currently on V4.3.3

At any rate thanks for thinking along. PS I have given FTP access but the CS Cart developers (CS Cart Helpdesk) did not find this yet. I only figured out yesterday that I needed to remove the password restriction on the developers root folder.

OK, it i very strange that you were not experiencing any problems with permissions before and now with copy of data to sub directory you are. Were you copying via ftp or what?

My upgrade was simple

In directadmin I got filemanager, made a 100% copy of 43x live store to /437 subdomain

edit config.local.php

created 437 database

exported 43x via phpmyadmin database and imported in to 437 database, now I have 2 identical copies of live site just one is on subdomain. There cannot be any permission problems arise unless you had them before.. Now I did upgrade.

After done moved public_html contend to public_html/old and public_html/437 to public_html/

All done.

Well based on what you describe here I can tell you that I followed the same steps as you did, only difference being that you work with Direct admin on a Windows server ?? and I work with WHM / Cpanel with NginX php 5.6 . But in all other aspects I just did the same as you.

Darius

Was your /var/upgrade/ directory also missing a restore.php file ??

Following solution

http://forum.cs-cart.com/topic/44904-best-practice-in-upgrading-a-cs-cart-store/?view=findpost&p=251256

is for permission problem on localhost (windows pc or windows server)

Well based on what you describe here I can tell you that I followed the same steps as you did, only difference being that you work with Direct admin on a Windows server ?? and I work with WHM / Cpanel with NginX php 5.6 . But in all other aspects I just did the same as you.

This one I done on centos server with directadmin

http://forum.cs-cart.com/topic/44904-best-practice-in-upgrading-a-cs-cart-store/?view=findpost&p=251274

No not missing. If it missing them cart for some reason is not able to put it there. You need to set correct owner/group and chmod 777

Alternatively it asks you to put your ftp server details here

http://demo.cs-cart.com/admin.php?dispatch=settings.manage§ion_id=Upgrade_center

Darius

Was your /var/upgrade/ directory also missing a restore.php file ??

PS just looked at my error logs:

2016-05-23 18:12:35: Start installation of the "core" upgrade package
2016-05-23 18:12:35: ================================================
2016-05-23 18:12:35: Get all available validators
2016-05-23 18:12:35: Execute "Upgrades directory" validator
2016-05-23 18:12:35: Execute "collisions" validator
2016-05-23 18:12:35: Execute "permissions" validator
2016-05-23 18:12:35: Execute "restore" validator
2016-05-23 18:12:35: Upgrade stopped: Awaiting resolving validation errors: restore

No not missing. If it missing them cart for some reason is not able to put it there. You need to set correct owner/group and chmod 777

Alternatively it asks you to put your ftp server details here

http://demo.cs-cart.com/admin.php?dispatch=settings.manage§ion_id=Upgrade_center

Yes I filled in the data in this form

No not missing. If it missing them cart for some reason is not able to put it there. You need to set correct owner/group and chmod 777

I already did that, my test environment resides in the public_html/dev/ folder within the root folder of my live (production) store.

If you check my old issue here

http://forum.cs-cart.com/topic/42954-validation-issue-upgrade-433sp1-434-on-localhost/?view=findpost&p=238107

it looks very similar

Validation issue

Validator "Restore" returned fail status

Unable to prepare restore script.

I really suggest you giving a try this

In app\Tygh\UpgradeCenter\App.php

from this

$target_restore_file_name = 'restore_' . date('Y-m-d_H:i:s', TIME) . '.php';

change to this

$target_restore_file_name = 'restore_' . date('Y-m-d_H-i-s', TIME) . '.php';

I really suggest you giving a try this

In app\Tygh\UpgradeCenter\App.php

from this

$target_restore_file_name = 'restore_' . date('Y-m-d_H:i:s', TIME) . '.php';

change to this

$target_restore_file_name = 'restore_' . date('Y-m-d_H-i-s', TIME) . '.php';

I did take at look at your solution, however I was not able to find this particular line of code anywhere iu that App.php file.

Even 437 has same line, it did not go away...

     * Prepares restore.php file.
     *
     * @return bool if all necessary information was added to restore.php
     */
    protected function prepareRestore($package_id, $content_schema, $information_schema, $backup_filename)
    {
        $logger = Log::instance($package_id);
        $logger->add('Preparing restore script');
    $upgrades_dir = $this->config['dir']['root'] . '/upgrades';
    $source_restore_file_path = $upgrades_dir . '/source_restore.php';

    $target_restore_dir_name = "{$package_id}_{$information_schema['from_version']}-{$information_schema['to_version']}";
    $target_restore_file_name = 'restore_' . date('Y-m-d_H-i-s', TIME) . '.php';

Hmm somehow your App.php file is totally different than mine:

An exerpt from my App.php file residing in the app\Tygh\UpgradeCenter older from line 568

    /**
     * Prepares restore.php file.
     *
     * @return bool if all necessary information was added to restore.php
     */
    protected function prepareRestore($backup_filename)
    {
        $restore_path = $this->config['dir']['root'] . '/var/upgrade/restore.php';
    $content = fn_get_contents($restore_path);

    $uc_settings = Settings::instance()->getValues('Upgrade_center');

    $data = "\$uc_settings = " . var_export($uc_settings, true) . ";\n\n";
    $data .= "\$config = " . var_export(Registry::get('config'), true) . ";\n\n";
    $data .= "\$backup_filename = '" . $backup_filename . "';\n\n";
    $restore_key = md5(uniqid()) . md5(uniqid('', true));
    $data .= "\$uak = '" . $restore_key . "';";

    $replaced = 0;
    $content = preg_replace('#\/\/\[params\].*?\/\/\[\/params\]#ims', "//[params]\n" . $data . "\n\n//[/params]", $content, -1, $replaced);

    if (!$replaced || !fn_put_contents($restore_path, $content)) {
        return false;
    }

    // Check if restore is available through the HTTP
    $result = Http::get(Registry::get('config.http_location') . '/var/upgrade/restore.php');
    if ($result != 'Access denied') {
        return false;
    }

    return $restore_key;
}

I just cannot seem to find that part of the code where yours is.

My upgrade was from Upgrade 4.3.3.SP1 - 4.3.4 your Upgrade 4.3.3 - 4.3.3.SP1, maybe upgrade file was updated only since 4.3.3.SP1, that is why its different. Part of the code I put here from 437 is from default package not live store. So problem is somewhere else.

There are many developers here you can help you. Contact them with ftp details, hope they help.