Spis treści
TA METODA AKTUALIZACJI NIE JEST JUŻ ROZWIJANA I WSPIERANA. Przeczytaj instrukcję automatycznej aktualizacji. Automatyczna aktualizacja jest jedyną oficjalnie zalecaną metodą aktualizowania PrestaShop. |
Przeprowadzanie ręcznej aktualizacji jest długim i złożonym procesem, który powinien być stosowany jedynie z konieczności - na przykład kiedy dokonanie automatycznej aktualizacji nie jest możliwe.
Z tego względu ręczna aktualizacja powinna być procedurą zarezerwowana dla ekspertów, czyli osób potrafiących korzystać z narzędzi deweloperskich takich jak WAMP, phpMyAdmin itp. Jeśli nie jesteś ekspertem, możesz poprosić o pomoc kolegę, lub zapłacić za pomoc zawodowemu deweloperowi. Należy spodziewać się, że ręczna aktualizacja może potrwać dwie godziny, lub nawet więcej. Zarezerwuj sobie czas, żeby doprowadzić procedurę do końca.
Główna idea ręcznej aktualizacji jest prosta: zamiast ryzykować bezpośrednią aktualizację Twojego sklepu, przeprowadzimy całą procedurę na Twoim komputerze lokalnym, używając zainstalowanego na nim serwera PHP i MySQL, takiego jak WAMP czy XAMPP. Jeśli uda się zaktualizować Twój sklep lokalnie, trzeba będzie przeprowadzić ten sam proces jeszcze raz - tym razem na Twoim serwerze WWW.
Od rozpoczęcia procesu, Twój sklep powinien być wyłączony (czyli działać w trybie "Przerwa techniczna") po to, aby klienci, którzy mogliby w tym czasie robić zakupy w Twoim sklepie, nie utracili swoich zamówień. Oznacza to, ze podczas wykonywania ręcznej aktualizacji, czyli w okresie około dwu godzin, w Twoim sklepie nie będzie można robić zakupów.
Ta niezbyt obszerna sekcja jest skierowana jest do osób już zaznajomionych z instalacją i aktualizacją na serwerze aplikacji web wykonanych w technologii PHP/MySQL. Jeśli nie czujesz się komfortowo ze względu na brak wiedzy o szczegółach, kompletne instrukcje postępowania znajdziesz w sekcjach poniżej.
Wiele prezentowanych tu procedur wykonuje się na lokalnym serwerze WWW, zainstalowanym na Twoim komputerze. Zanim zaczniesz cokolwiek robić, pobierz i zainstaluj lokalny serwer. Może to być WAMP, XAMPP, EasyPHP, MAMP albo jeszcze inny. Jeśli nigdy wcześniej nie instalowałeś serwera na swoim komputerze, przeczytaj rozdział zatytułowany "Czego potrzebujesz, by zacząć" przewodnika "Początek", a zwłaszcza rozdział "Instalacja PrestaShop" dostępny pod adresem http://doc.prestashop.com/display/PS16/Instalacja+PrestaShop |
Proces aktualizacji ręcznej składa się z następujących kroków:
/htdocs
, /www
, albo inny folder używany przez serwer, który zainstalowałeś). To właśnie w tej lokalizacji będziesz aktualizować swój sklep przy w pełni zachowanej kopii bezpieczeństwa (prestashop-prod)/install/upgrade/upgrade.php
./install
i przejdź do widoku zarówno Twojego sklepu, jak i jego panelu administracyjnego, żeby upewnić się, ze wszystko funkcjonuje poprawnie./install/upgrade/upgrade.php
./install
i przejdź do widoku zarówno Twojego sklepu, jak i jego panelu administracyjnego, żeby upewnić się, ze wszystko funkcjonuje poprawnie.Udało się! Ciesz się nowymi funkcjonalnościami zaktualizowanej wersji Twojego sklepu!
Poniechanie utworzenia kopii bezpieczeństwa Twojego sklepu naraża Cię na ryzyko utraty wszystkich danych bez możliwości ich odzyskania w przypadku wystąpienia problemów podczas aktualizacji. Nigdy nie pomijaj tego kroku. Nie przechodź do kroku 2 dopóki nie masz absolutnej pewności, że kopia bezpieczeństwa jest kompletna i w pełni funkcjonalna. Sprawdź kilka razy, czy na pewno tak jest. |
Wyłączenie Twojego sklepu na czas aktualizacji jest bardzo ważne. |
Przejdź do panelu administracyjnego i na stronie "Przerwa techniczna" dostępnej pod pozycją "Preferencje" w menu głównym, obok frazy "Włącz sklep" zaznacz opcję "Nie"
Jeśli aktualizujesz PrestaShop w wersji 1.4, opcja ta jest dostępna jako pierwsza na liście po wybraniu pozycji "Ustawienia" w menu głównym. |
W polu "Adres IP do zarządzania" (w wersji 1.4 "Adres IP do otwartego dostępu") dostępnym zaraz poniżej opcji "Włącz sklep", należy wpisać adresy IP, które nie zostaną objęte trybem "Przerwa techniczna". Dzięki temu będzie można oglądać sklep od frontu w czasie, kiedy będzie on wyłączony. Obok pola "Adres IP do zarządzania" znajduje się przycisk "Dodaj mój IP". Po jego wciśnięciu, adres komputera, z którego korzystamy zostanie dodany do wyjątków "Przerwy technicznej". Jeśli z jakichś przyczyn nie chcemy korzystać z tego przycisku, adres IP urządzenia, z którego aktualnie korzystamy możemy uzyskać na stronie: http://whatismyipaddress.com/
Powinieneś wykonać kopię bezpieczeństwa wszystkich plików składających sie na Twój sklep PrestaShop i zapisać ją na dysku Twojego komputera.
Istnieją dwa najczęściej stosowane sposoby tworzenia kopii bezpieczeństwa:
...lub...
Koniecznie powinieneś wykonać kopię bezpieczeństwa bazy danych Twojego sklepu.
Istnieją trzy sposoby wykonania tej czynności:
...lub...
Pobierz kopię bazy danych w panelu administracyjnym sklepu.
Przejdź do strony "Backup bazy danych" i dalej postępuj według wskazówek umieszczonych na tej stronie.
Ta strona dostępna jest w zależności od wersji PrestaShop:
|
Proces pobierania kopii może potrwać od 1 do 20 minut w zależności od jej rozmiaru. Kiedy na stronie tworzenia kopii pojawi się link do pobrania kopii bazy zatytułowany "Pobierz plik kopii zapasowej", naciśnij go i pobierz plik. Upewnij się, że kopia, którą pobrałeś jest w pełni funkcjonalna i przede wszystkim kompletna. Rozpakuj plik zip i zanim przejdziesz do następnego kroku upewnij się, że wyekstrahowany plik o rozszerzeniu .sql nie zawiera ŻADNYCH BŁĘDÓW.
...lub...
Zapisz kopie bazy danych w folderze "prestashop-prod" na pulpicie Twojego komputera znanym Ci już z poprzednich czynności w ramach niniejszej instrukcji - tym samym, w którym przechowujesz kopie plików Twojego sklepu.
Jeśli nie edytowałeś domyślnych tłumaczeń, ani nie dodawałeś nowych (odnosi się to do wszystkich tłumaczeń - również tych wykorzystywanych przez moduły), przejdź do kroku 2.
Aby zachować Twoje tłumaczenia:
Przejdź do strony "Tłumaczenia" w panelu administracyjnym.
Strona ta jest dostępna w zależności od wersji PrestaShop:
|
Całą procedurę powtórz dla każdego języka, który został przez Ciebie dodany, zmodyfikowany, albo poprawiony.
Czy folder "prestashop-prod" zawiera...
Po sprawdzeniu zawartości folderu "prestashop-prod" i upewnieniu się, że wszystkie kopie bezpieczeństwa są poprawne, i że umożliwiają odtworzenie Twojego sklepu w razie, gdyby aktualizacja zakończyła się niepowodzeniem, przejdź do kroku 2. |
Odwiedź stronę https://www.prestashop.com/pl/pobranie i pobierz najnowszą wersję PrestaShop (podaj swój adres e-mail, odpowiedz na pytanie formularza, wybierz język Twojego sklepu i wciśnij przycisk "Pobierz teraz").
Powinieneś pobrać plik zip o nazwie: prestashop_1.6.x.zip
(gdzie "x" jest cyfrą określającą numer wersji).
Na pulpicie Twojego komputera utwórz folder o nazwie "prestashop-prep". Następnie rozpakuj dopiero co pobrany plik zip i umieść jego zawartość w folderze "prestashop-prep". W tym folderze przygotujesz pliki, za pomocą których dokonasz aktualizacji.
Uwaga: make it so that you do not have the /prestashop
folder from the .zip
archive at the root of the "prestashop-prep" folder. You should rather directly put the files and folders that it contains, so as to have the same overview for the "prestashop-prod" and "prestashop-prep" folders.
If you do not yet have an unzipping tool, you can download a free one here: http://www.7-zip.org/. |
In that "/prestashop-prep
" folder, select the "/admin
" folder and give it the same name as the administration folder of your production store. For instance, if you're "prestashop-prod" uses the name admin123
, give that same name to the /admin
folder in your "prestashop-prep" folder.
Now comes the part where you will copy the files that are unique to your production shop into the folders of the new version. In practice, the idea is to build a "prestashop-prep" folder that would contain both the latest version of the standard files for PrestaShop, and all the files that you created and put online since you installed PrestaShop: images, logos, pictures, translations, modules, etc.
This is an important step, because it enables you to safe-keep all the customizations from your store. Take the time to follow these instructions.
You will thus have to browse the folders and files that were stores in the "prestashop-prod" folder in order to the correct location in the "prestashop-prep" folder.
Answer "Yes" every time the system asks you to replace the existing files.
The following folders must be copied from your "prestashop-prod" folder to the recently unzipped "prestashop-prep" folder:
/mails
. Has all the mails templates, including those that you have modified./img
. Contains your logo and all the pictures of your store (categories, products, etc.). Take good care of these specific files and folders:logo.jpg
- your store's logofavicon.ico
- your store's faviconlogo_stores.gif
- your store's logo for the Store Locator's map/c
- your categories' images/cms
- your CMS page's images/co
- your attributes textural colors/m
- your manufacturers' logos/p
- your products pictures/scenes
- your categories' image-maps/st
- your physical stores' photos/su
- your suppliers' logos/img/admin
and /img/jquery-ui
./modules
. Only copy the modules that you have added since you installed PrestaShop for the first (and which where therefore not part of the default installation)./themes/themeName
. Only copy your current theme./themes/prestashop
): you must use the one from the new version (/themes/default
)./download
and /upload
. Contain all the downloadable products, the attached files and the customizable products. If you do no use any of these functionalities, do not copy these folders./classes
. In case you have added customized classes to this folder, copy them to the new /classes
folder.
When updating from a version below 1.4, you must manually edit these classes that you have customized. You do not have to edit classes that you didn't customize. In order to function properly with the latest version of PrestaShop, all these class files need to have their class name suffixed with "Core". Do not attempt these if you are not comfortable with PHP files.
|
/config
. You only have to copy one file, but it is essential: the settings.inc.php
file./translations
- if you are using another language than the ones available in the default installation, you will have to copy that language's folder in the /translations
folder of the new installation. Failing that, the update will not work properly.Your "prestashop-prep" folder is now ready. You are not to touch it again, and will only work using a copy of it from now on.
The "prestashop-prep" folder, which you initially unzipped from the archive of the latest PrestaShop version, now contains all of your customizations from the "prestashop-prod" folder (and therefore, from your shop, which is currently running online – and should still be in maintenance mode). In this next step, you will copy this folder to your local web server, in order to test that the update does run without any issue.
Start your local server (WAMP, XAMPP, EasyPHP, MAMP or any other), and make sure that the Apache and MySQL are running.
The main idea here is to locally check that you shop can be update without problem on a local server, in order to minimize the risk of failure when starting the update on your production store. For this reason, you should try to replicate your online environment on your local server, so as to reduce the risk of receiving a bad surprise once you try the update online. Contact your web host in order to get information about the Apache, PHP and MySQL configuration of your web server, and edit the If you cannot edit the configuration files of your local server, then do note that the differences with your online server can have a huge impact on the smooth running of the update, as that what works in one environment could not work anymore in another. Typically, memory limits and having absolute paths rather than relative ones. |
Open the web folder for your local server (/htdocs
, /www
, /web
or another name, depending on the server), and copy the "prestashop-prep" folder into it.
Do not just move the "prestashop-prep" folder to your local web folder! This way, in case of a problem with the local update, you will be able to open the "prestahop-prep" folder and make the necessary changes, before copying it again into the local web folder and try to update another time. |
Put the "prestashop-prep" at the root of the web folder of your local web server.
The local files should now be up to date, but the database also needs to be updated. This is what the update script is for. It is part of the files from the new PrestaShop 1.6 version.
You must have a working knowledge of phpMyAdmin before applying the steps of this section. |
We are now going to make use of the .sql
file that you backed up in the "prestashop-prod" folder earlier. Using this file, you will recreate the production database on your local server. In order to do that, simply follow these steps:
Click on the "Browse" button and select the backup .sql
file from your production store, which should be in the "prestashop-prod" folder.
Check that the "Max." value displayed by phpMyAdmin is higher than the .sql
file's size. If not, you will have to edit your local server's php.ini
, particularly the upload_max_filesize
value, the post_max_size
value or even the memory_limit
value as a last resort. This being done, restart the local Apache and MySQL servers in order to apply your modifications.
Instead of changing the server settings, you can also try compressing the |
Wait while phpMyAdmin is uploading the file and adding tables to the database. Once it is done, you will see the tables appear in phpMyAdmin's left sidebar.
All that's left to do now is to link your PrestaShop PHP files to the local server's data. To that end, you will have to edit PrestaShop's database information in order to make them target the local database.
Open the /config/settings.inc.php
file, and edit the following lines:
_DB_SERVER_
: replace the MySQL server's address for your production store, with the one for your local server. It should be "localhost" or "127.0.0.1"._DB_NAME_
: replace the name of your production database by the one for the local database in which you have imported your production data tables._DB_USER_
: replace the username for your production database by the one for your local server. It should probably be "root"._DB_PASSWD_
: replace the MySQL user's password for your production database by the one for your local server's user. It should probably be an empty field: "".PrestaShop can now access your production database on your local server, all you have to do is to start the update script.
Did you follow these steps?
If you did do all that, then you can continue to Step 3.
Visit your store's update script URL; for instance: http://127.0.0.1/prestashop-prep/install/upgrade/upgrade.php (Replace "prestashop-prep" with the actual name of the folder that you have copied in your local server's web folder).
If it returns a 404, then you might not have copied all the files from the latest PrestaShop 1.6 version. Go through this previous step again.
If the address returns a 404 error, you might have forgotten some files from the latest version of PrestaShop 1.6. Do the various steps again: delete the folder which you have copied in the local web folder (but set aside the |
Once the script is started, leave your browser alone! Do not close it or click the "Back" button: the upgrade script is working, it can take several minutes. Let it do the work for you!
For the most part, the update script takes care of updating the SQL database, which can prove a very arduous task in itself. It also handles the update of the config/settings.inc.php
configuration file, depending on your configuration and environment, as well as other aspects of PrestaShop's inner working.
Once the update is finished, a XML file should be displayed in your browser. This is expected, but can surprise you, since it doesn't look like any regular web page, and each browser has its own way of displaying it. For instance, Firefox will first display a warning message, "This XML file does not appear to have any style information associated with it. The document tree is shown below", above the content of the XML file itself. This will be improved in later versions of the script.
It should begin with the following line:
<action result="ok" error=""> |
The "ok" is the important art: it worked! The hardest part is now behind you, now come the final details.
On your local web server, inside the /prestashop-prep
folder, you should delete:
/install
folder, which contains the install script.README
files, which contain information about the PrestaShop install.CHANGELOG
file, which contains information about the latest changes in PrestaShop.You can now access your local store's address (in our example http://127.0.0.1/prestashop-prep/), which should display the maintenance page with your logo. This is expected, since your store should be in maintenance mode.
If your store's theme does not display, but you instead see a white page with a warning, such as "Your 'theme name' theme is not available. Please check the name and permissions of the theme folder", then you have forgotten the step where you were supposed to copy your theme over to the Go to your "prestashop-prod" folder's |
If your store's logo does not display, but instead you see a "YourLogoHere" logo, then you have forgotten the step where you were supposed to copy your customized images from the "prestashop-prod" folder over to the "prestashop-prep" folder. Go to read Step 2 of this chapter ("Step 2 - Getting Ready for the New Version") in order to copy the right files and folders. |
Now go to your store's administration page, using your customized /admin
folder name. You will have to log in using your usual credentials. Browse through the various administration page and check if the content is indeed there and that all the back office pages do work, then take the store out of maintenance mode in order to explore the front office pages the way a regular visitor would, and make sure that they all work.
All of the updates do not run smoothly, and for very different reasons. In order to help you, the update script displays an error code at the beginning of the XML result. In case of an error, the page starts like so:
<action result="fail" error="27" /> |
As you can see, the "result" attribute does not contain "ok" anymore, but "fail".
Here are some of the most frequent errors:
Error code | Meaning | Possible solution |
---|---|---|
5 | The configuration file cannot be read. | Edit the access rights for the |
6 | The configuration file cannot be written. | Edit the access rights for the |
27 | The installation is too old. | You should use the latest version of PrestaShop. |
28 | You are already using the target version. | The version to which you are updating is the same as the one that is already installed. |
29 | There is no older version. | Have you copied the |
31 | SQL update files cannot be found. | Check that the |
32 | Unable to update. | Some files might be missing or badly copied. Restart the whole process from the start. |
33 | Error while trying to read the SQL update files. | Check that the files are indeed in the |
34 | Internal SQL error. | The SQL update files might be corrupted. Download the new version's archive again, and use its files from the |
35 | Cache is enabled. | Disable PrestaShop's cache before you start the update script: open the |
When the update script fails, it is difficult to see if it has been able to make even part of the update. Before you try the update again, you should reset the files and database to their backup state:
If you did export your custom translations during step 1 (Backups), import them back into your new store by going to the "Localization" menu, then the "Translations" page, then use the "Import a language pack manually" section.
To make sure that everything is working properly on your updated local store, you should perform a few tests:
This is not a complete list, you should perform as many tests as possible.
If you notice that some aspects of the updated store do not work properly:
If every test is successful, congratulations! Proceed to step 5.
Now that you've reached this stage, you should have succeeded in updating your shop on your local server. In doing so, you get a better guarantee that performing the update on your web hosting will go smoothly. Your "prestashop-prep" folder contains all the necessary files, because you have changed its content based on issues noticed during your tests from the previous step.
This "guarantee" can never be 100%, as both environments (local server and web hosting) may differ. Your best bet is to set up your local server so that it matches your production server as best as it can. |
Your online shop has been in maintenance mode since the beginning of your process, so that you do not lose orders, carts or even new clients during the update. If this is not already the case, turn the store into maintenance mode now, and repeat the process from the beginning - unless you do not fear losing the changes that you made since the beginning.
Other than putting your files online rather than on your local server, the online process varies little from the one that you tested locally:
.sql
file./install/upgrade/upgrade.php
./install
and browse your front office and your back office to make sure everything works.You need to again perform all the tests already carried out locally, to ensure that nothing fails despite the change from a local environment to a production environment.
If you did export your custom translations during step 1 (Backups), import them back into your new store by going to the "Localization" menu, then the "Translations" page, then use the "Import a language pack manually" section.
You should verify that the domain name assigned in the database is indeed the one that you are working with. To do so, visit the "Preferences" menu, then the "SEO & URLs" page.
You must check the following information, from the "Set shop URL":
/prestashop/
If you cannot reach the administration interface, you will have to go through the database management tool used by your web host, such as phpMyAdmin:
ps_shop_url
,domain
, domain_ssl
and physical_uri
columns so that they match the location of your production store.As you can see, the address and path to your store are no longer stored in the Therefore, you can open the |
You must make sure that everything is working properly on your update store. These are a few tests to perform:
This is not a complete list; you should perform as many tests as possible.
If you notice that some aspects of the updated store do not work properly:
If every test is successful, congratulations!
Great! You are now at the end of the update process!
All that's left to do is to re-enable your stop. Go to the "Maintenance" page from the "Preferences" menu, and choose "Yes" for the "Enable Shop".
Go the your store's home page, and browse the pages as if you were a regular visitor, in order to check one final time that everything is working correctly.
You are done! Congratulations on upgrading to the latest and best version of PrestaShop!
Doing a manual update is a long and detailed process, which should only be used out of necessity – for instance, if you cannot make an automatic update.
Therefore, manual updates should be reserved to experts, meaning those who know how to use development tools such as WAMP, phpMyAdmin, etc. If this is not your case, you should ask a friend or pay a developer to help you. Do anticipate spending one or two hours, maybe more: take the time to do things right.
The idea behind manual update is simple: rather than risking a direct update on your online shop, we are going to do all the work on your computer, using a local PHP/MySQL server such as WAMP or XAMPP. Once the local update is successful, you will have to do it all again, this time online.
From the start of the process, your online shop should be disabled (in "maintenance" mode") so as to make sure that your clients will not lose their carts and orders during the update process. In effect, this means that your shop will be closed for business during the whole process (one to two hours).