Updating a PrestaShop module: the Upload failed error

by Presta365 Technical guides

Updating a module. You upload the zip of the new version on top of the one already installed, from the Module Manager: settings, content and data all stay where they are. If instead of the confirmation you read "Upload failed", the module may have been switched off without anyone telling you. Below is what happens and how to get it running again.

1. How to update a module

  1. Download the zip of the new version from the My licenses page of your account.
  2. In the back office go to Modules → Module Manager → Upload a module and pick the zip.
  3. PrestaShop replaces the files and runs the upgrade by itself. Do not uninstall anything: uninstalling wipes your settings, updating does not.
  4. When the upload is over, open Configure and check that the version number is the new one.
Take a backup before you update, and update when the shop is quiet. This is true for any module, from any author.

2. If the update says "Upload failed"

When you upload the zip of a module you already have installed, PrestaShop replaces the files and then runs the upgrade. If anything goes wrong halfway through, PrestaShop disables the module to be safe, and unfortunately it does not tell you: all you see is the "Upload failed" message.

Nothing is lost: the module settings and data are still there. You only have to switch it back on, once the cause is out of the way.

Step 1: check whether the module was disabled back office

Go to Modules, Module Manager, look for the module and see whether the button says "Enable" instead of "Configure". If it says "Enable", the module has been disabled.

Step 2: with several shops, check them one by one multistore

At the top left pick one shop at a time and look at the module in each. It can be on in one shop and off in another: in that case the list looks fine, but on that shop the module no longer works.

Step 3: remove the cause file permissions

Almost always there is a single cause: the module files on the server cannot be written by the program that runs the site. Ask your host or your technician to fix the owner and the permissions of the modules/<module name> folder: usually the same owner as the rest of the site files, folders 755 and files 644. Other possible causes: the disk is full, or the uploaded file is larger than the server accepts.

Step 4: upload the zip again last step

Once the cause is fixed, upload the zip again: this time the upgrade goes through. If you need the module working sooner, press "Enable" in the Module Manager, but upload the zip again anyway, otherwise you are left with half-replaced files.

3. Why it happens

It is not a defect of the module you are updating. If PrestaShop meets any error while the zip is being uploaded, it disables the module it was working on: this happens with any module, from any author, with multistore on or off. The choice is a cautious one, because if the file replacement stopped halfway the server is left with a module made of some new files and some old ones, and running it like that would be worse. The only thing missing is the warning: PrestaShop writes "Upload failed" and does not say that the module has been switched off.

4. How to stop it happening again

  • Always upload the site files with the same user PHP runs as. If you uploaded over FTP, or installed from the command line as administrator, the permissions need fixing.
  • Check the free disk space before updating.
  • If the zip is large, ask your host about the PHP limits upload_max_filesize and post_max_size.
  • Update one module at a time and check the result before moving to the next.

5. Frequently asked questions

Do I lose the module settings when I update?

No. Uploading the zip only replaces the files: settings, content and data stay in the database. They are lost if you uninstall the module, but updating never requires uninstalling.

Do I have to uninstall the module before updating it?

No, and you had better not. Upload the new zip on top of the version you already have: PrestaShop sees that the module is there and runs the upgrade by itself.

I pressed "Enable" and the module works: do I still have to upload the zip?

Yes. If the upload stopped halfway, the server holds files from two different versions. Enabling gets the module running straight away, but the update has to be completed by uploading the zip again.

How do I know whether the module is off on just one of my shops?

Use the selector at the top left of the back office to pick one shop at a time and open the Module Manager: the module has to be checked in each shop. In the "all shops" view it can look enabled even when it is not on one of them.

Where do I find the zip of the new version?

On the My licenses page of your account, which always holds the latest version you are entitled to. Updates are included for 12 months, then renewal is optional.

Leave a comment

Comments are moderated before publication.

← Blog

Loading...
Back to top