Unable To Prepare Restore Script.

Hi,

I am getting the following error when I try to upgrade CS-Cart from 4.13.3 to 4.14.1;

Validation issue

Validator "Restore" returned fail status

			File
	


	
		
			Unable to prepare restore script.

I checked all the permissions. In fact I gave 777 for the entire folder as well, but still getting the same message.

Please your help/guidance will be highly appreciated.

Thanks and Br.....

What does your server require for permissions? If you are running suPHP then it cannot be 777. It should be 755 for folders and 644 for files.

We just fixed this on a build. The order of things to check are:

1) Permissions.

2) Are you upgrading a DEV version of your license or the main production domain?

The restore error is because the upgrade routine cannot hit that file.

e.g. You are trying to upgrade localhost or IP-based install and not a FQDN,

What does your server require for permissions? If you are running suPHP then it cannot be 777. It should be 755 for folders and 644 for files.

We just fixed this on a build. The order of things to check are:

1) Permissions.

2) Are you upgrading a DEV version of your license or the main production domain?

The restore error is because the upgrade routine cannot hit that file.

e.g. You are trying to upgrade localhost or IP-based install and not a FQDN,

1) Permissions --> At first the files/folder permissions as you mentioned. But since I was getting this error and did a google search, read about permissions. So I changed it to 777, so not to have the permission issue.

2) It is a dev site for now, eventually after Dev it will be production site.

3) It is an active FQDN. sub-domain of our live website.

Please take a look

https://docs.cs-cart.com/latest/upgrade/possible_upgrade_issues.html?r#validator-restore-returned-fail-status

Please take a look

https://docs.cs-cart.com/latest/upgrade/possible_upgrade_issues.html?r#validator-restore-returned-fail-status

Thanks for sharing the link;

The restore validator checks whether or not the pre-upgrade version of the site can be restored from backup. If this error occurs, here are the possible causes:

  • Wrong permissions on files and directories. --> The entire cs-cart folder has been changed to 777, but still the same issue.

  • The web server doesn’t allow to run the restore-from-backup script. This script is created with the same permissions as specified in DEFAULT_FILE_PERMISSIONS in the config.local.php file. --> I have changed the DEFAULT_FILE_PERMISSIONS to 0777, but still the same.

  • cURL-related problems --> Curl is installed, but don't know how to verify to check for any errors. the normal curl commands are working fine.

  • The upgrades directory or the source_restore.php file in that directory is missing. If the file or directory is missing, you can take them from the installation archive of your current version of CS-Cart or Multi-Vendor. --> File Present in the upgrades Folder

  • The upgrade is performed on a test copy of the installation on a different server with the same domain name; the hosts file on the client’s computer has an entry with the IP address of the test copy. --> The upgrade server has the correct host defined for which it is serving. the production and the dev are two separate servers.

Again, does your server allow 777 is my question. If it is using fCGI or suPHP that will not work.

Also do you have this under any .htaccess-based password protection? I'd remove that for the upgrade.

Lastly, have you increased all PHP values like max post size, max memory and increase execution times to ridiculous levels (Yes, I'm looking at you CS-Cart Developers) like 6000 seconds in both the php.ini and config.local.php?

Again, does your server allow 777 is my question. If it is using fCGI or suPHP that will not work.

Also do you have this under any .htaccess-based password protection? I'd remove that for the upgrade.

Lastly, have you increased all PHP values like max post size, max memory and increase execution times to ridiculous levels (Yes, I'm looking at you CS-Cart Developers) like 6000 seconds in both the php.ini and config.local.php?

Thanks for your kind response.

If it is using fCGI or suPHP that will not work. --> Please can you let me know what permissions need to be given.

Also do you have this under any .htaccess-based password protection? I'd remove that for the upgrade. --> No Password protected .htaccess

I found these error logs in the core upgrade text file. Can it help someone to guide what am I missing and needs to be done. It is a Ubuntu/Nginx server combination;

tail -f var/upgrade/core_log.txt

2021-12-25 13:37:11: Correcting upgrades directory permissions...

2021-12-25 13:37:11: ----------

2021-12-25 13:37:11: Changing permissions of "/var/www/html/website.com/upgrades" to 755

2021-12-25 13:37:11: Using chmod()... FAILED

2021-12-25 13:37:11: Using FTP...

2021-12-25 13:37:11: Connection established

2021-12-25 13:37:11: FTP chmod result: FAILED

2021-12-25 13:37:11: ----------

2021-12-25 13:37:11: Upgrades directory permissions: drwxrwxrwx root:root

2021-12-25 13:37:11: Checking restore script availability via HTTP/HTTPS

2021-12-25 13:37:21: HTTP error: curl (28): Connection timed out after 10001 milliseconds

2021-12-25 13:37:21: Restore script is NOT available via HTTP at "https://mywebsite.com/upgrades/core_4.13.3-4.14.1/restore_2021-12-25_13-37-11.php".

2021-12-25 13:37:21: Upgrade stopped: unable to prepare restore file.

The folder permission is solved.

Now only curl connection timeout error.

Any guesses please.....

Upgraded. For Curl it was the firewall issue.

Thanks for all for giving your time and guiding me to solve the issue.

Also would like to share the below which guided me to the log file to check the issue.

"Please check the upgrade log (var/upgrade/core_log.txt)"

https://forum.cs-cart.com/topic/48897-upgrade-443-451-validation-issue-validator-restore-returned-fail-status/