Child pages
  • Ręczna aktualizacja
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 34 Next »

Spis treści

TA METODA AKTUALIZACJI NIE JEST JUŻ ROZWIJANA I WSPIERANA.
JEŚLI TO TYLKO MOŻLIWE, NALEŻY UŻYĆ DARMOWEGO MODUŁU 1-CLICK UPGRADE.

Przeczytaj instrukcję automatycznej aktualizacji. Automatyczna aktualizacja jest jedyną oficjalnie zalecaną metodą aktualizowania PrestaShop.

Ręczna aktualizacja

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.

Szybkie instrukcje

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:

  1. Utwórz kopię bezpieczeństwa Twojego sklepu i zapisz ją:
    • Wyłącz sklep (przejdź do trybu "Przerwa techniczna"; opcja ta dostępna jest na różnych stronach w zależności od wersji PrestaShop - dla wersji 1.4 na stronie "Ustawienia" w sekcji "Ustawienia ogólne" pozycja "Włacz sklep"; dla wersji 1.5 na stronie "Przerwa techniczna" pod pozycją "Preferencje" w menu głównym).
    • Korzystając z klienta FTP połącz się ze swoim zdalnym serwerem WWW i skopiuj wszystkie pliki i foldery wraz z zawartością umieszczone w folderze głównym Twojego sklepu do dopiero co utworzonego folderu  "prestashop-prod" na pulpicie Twojego komputera. Będzie to kompletna kopia plików składających się na Twój sklep.
    • Utwórz kopię bazy danych podłączonej do sklepu (w każdej wersji PrestaShop można do tego celu użyć phpMyAdmin, albo wbudowanego narzędzia w panelu administracyjnym sklepu: dla PrestaShop 1.4: strona "Narzędzia / Kopie zapasowe"; dla PrestaShop 1.5 - strona "Zaawansowane / Backup bazy danych").
    • Utwórz kopię specyficznych dla Twojego sklepu tłumaczeń (dla PrestaShop 1.4: sekcja "Export języka" na stronie "Narzędzia / Tłumaczenia"; dla PrestaShop 1.5 - sekcja "Export języka" na stronie "Lokalizacja / Tłumaczenia").
  2. Przygotuj się na nową wersję:
    • Pobierz i rozpakuj najnowsza wersję PrestaShop: https://www.prestashop.com/pl/pobranie. Wypakowane pliki umieść w dopiero co utworzonym na pulpicie folderze "prestashop-prep".
    • Skopiuj Twoje "osobiste" pliki (zdjęcia produktów, loga, obrazki przypisane do kategorii, tłumaczenia, moduły itp) z "prestashop-prod" do "prestashop-prep" na pulpicie Twojego komputera. Szczegółowa lista dostępna jest w dalszej części tego przewodnika.
    • Skopiuj folder "prestashop-prep" do folderu web Twojego lokalnego serwera (/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)
    • Odtwórz bazę danych Twojego sklepu na serwerze lokalnym: korzystając z phpMyAdmin utwórz nową pustą bazę danych, do której skopiuj następnie dane z bazy skopiowanej w Twoim sklepie na samym początku procedury. 
  3. Rozpocznij lokalną aktualizację:
    • Uruchom skrypt aktualizacji na Twoim lokalnym serwerze za pośrednictwem przeglądarki internetowej. W PrestaShop w wersji 1.6 skrypt ten umieszczony jest na końcu ścieżki  /install/upgrade/upgrade.php.
    • Sprawdź parametry aktualizacji przed jej rozpoczęciem: podążaj za wskazówkami wyświetlanymi na ekranie i upewnij się, ze serwer spełnia wymagania techniczne stawiane przez nową wersję. 
    • Zakończ aktualizację: po otrzymaniu komunikatu o zakończeniu aktualizacji, usuń folder /install i przejdź do widoku zarówno Twojego sklepu, jak i jego panelu administracyjnego, żeby upewnić się, ze wszystko funkcjonuje poprawnie.
  4. Zapewnienie jakości i testy:
    • Zaimportuj do nowego sklepu tłumaczenia wyeksportowane ze starego sklepu (możesz tego dokonać używając funkcji "Ręczne importowanie pakietu językowego" dostępnego na stronie "Lokalizacja / Tłumaczenia").
    • Sprawdź, czy szablon zachowuje się zgodnie z oczekiwaniami. Jeśli nie, trzeba będzie zmieniać pliki szablonu.
    • Dokładnie przetestuj funkcjonowanie sklepu: utwórz konta, kup produkty, anuluj zamówienia, sprawdź faktury itd.
  5. Rozpocznij aktualizację na zdalnym serwerze WWW:
    • Używając klienta FTP zastąp pliki Twojego sklepu plikami skopiowanymi z folderu  "prestashop-prep".
    • Uruchom skrypt aktualizacji na Twoim zdalnym serwerze za pośrednictwem przeglądarki internetowej. W PrestaShop w wersji 1.6 skrypt ten umieszczony jest na końcu ścieżki /install/upgrade/upgrade.php.
    • Sprawdź parametry aktualizacji przed jej rozpoczęciem: podążaj za wskazówkami wyświetlanymi na ekranie i upewnij się, ze serwer spełnia wymagania techniczne stawiane przez nową wersję. 
    • Zakończ aktualizację: po otrzymaniu komunikatu o zakończeniu aktualizacji, usuń folder /install i przejdź do widoku zarówno Twojego sklepu, jak i jego panelu administracyjnego, żeby upewnić się, ze wszystko funkcjonuje poprawnie.
    • Zaimportuj do nowego sklepu tłumaczenia wyeksportowane ze starego sklepu (możesz tego dokonać używając funkcji "Ręczne importowanie pakietu językowego" dostępnego na stronie "Lokalizacja / Tłumaczenia").
    • Sprawdź, czy nazwa domeny głównej jest poprawna (sekcja "Ustaw URL sklepu" na stronie "Preferencje / SEO&URL").
    • Odtwórz pliki robots.txt  (sekcja "Generowanie pliku robots" na stronie "Preferencje / SEO&URL").
    • Sprawdź, czy szablon w dalszym ciągu zachowuje się zgodnie z oczekiwaniami. Jeśli nie, trzeba będzie zmieniać pliki szablonu.
    • Dokładnie przetestuj funkcjonowanie sklepu: utwórz konta, kup produkty, anuluj zamówienia, sprawdź faktury itd.
  6. Włączenie zaktualizowanego sklepu
    • Włącz Twój sklep (Strona "Przerwa techniczna" dostępna pod pozycją "Preferencje" menu głównego)

Udało się! Ciesz się nowymi funkcjonalnościami zaktualizowanej wersji Twojego sklepu! 

Krok 1 - Utwórz kopię bezpieczeństwa Twojego sklepu i zapisz ją 

Uwaga

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 - włączenie przerwy technicznej

Uwaga

Wyłączenie Twojego sklepu na czas aktualizacji jest bardzo ważne.
Daje ono pewność, że w czasie aktualizacji wszelka aktywność w sklepie będzie niemożliwa, a zwłaszcza składanie zamówień przez klientów. Nawet  jeśli aktualizacja się nie powiedzie i trzeba będzie wrócić do wersji sklepu sprzed aktualizacji, nie utracisz żadnych zamówień i żaden z twoich klientów nie będzie rozczarowany.

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/

Tworzenie kopii bezpieczeństwa plików 

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:

  • Poproś Twojego dostawcę usługi hostingu o skopiowanie Twoich plików.
    Upewnij się, że kopia, którą otrzymałeś jest funkcjonalna (umożliwia bezproblemowe odtworzenie sklepu) i w pełni odzwierciedla aktualny stan twojego sklepu (zawiera aktualny stan produktów, kategorii, zamówień itd).

...lub...

  • Używając klienta FTP skopiuj wszystkie pliki sklepu z Twojego serwera na Twój komputer.
    Możesz użyć tego sposobu tylko wtedy, kiedy Twój dostawca hostingu zapewnia Ci dostęp do serwera za pośrednictwem protokołu FTP. Na pulpicie Twojego komputera utwórz folder "prestashop-prod", po czym używając klienta FTP (takiego jak FileZilla, którego możesz pobrać ze strony http://filezilla-project.org/), zaznacz wszystkie zamieszczone na serwerze pliki i foldery składające się na Twój sklep (użyj skrótu klawiszowego Ctrl + A) i skopiuj je do folderu "prestashop-prod" na pulpicie Twojego komputera.

Tworzenie kopii bezpieczeństwa bazy danych

Koniecznie powinieneś wykonać kopię bezpieczeństwa bazy danych Twojego sklepu.

Istnieją trzy sposoby wykonania tej czynności:

  • Poproś Twojego dostawcę usługi hostingu o skopiowanie bazy danych Twojego sklepu.
    Upewnij się, że kopia, którą otrzymałeś jest w pełni funkcjonalna, świeża i kompletna.

...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:

    • PrestaShop 1.4: zakładka "Kopie zapasowe" dostępna pod pozycją "Narzędzia" menu głównego.
    • PrestaShop 1.5 i nowszy: zakładka "Backup bazy danych" dostępna pod pozycją "Zaawansowane" menu głównego.

    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...

  • Pobierz kopię bazy danych korzystając z phpMyAdmin.
    Upewnij się, że kopia, którą pobrałeś jest w pełni funkcjonalna, świeża i przede wszystkim kompletna, Jeśli baza danych Twojego sklepu jest zbyt duża, proces utworzenia jej kopii może zakończyć się niepowodzeniem. W takim przypadku skontaktuj się z Twoim dostawcą hostingu.

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.

Tworzenie kopii bezpieczeństwa Twoich unikalnych tłumaczeń

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: 

  1. Przejdź do strony "Tłumaczenia" w panelu administracyjnym.

    Strona ta jest dostępna w zależności od wersji PrestaShop:

    • PrestaShop 1.4: jako podstrona pozycji "Narzędzia" menu głównego.
    • PrestaShop 1.5 i nowszy: jako podstrona pozycji "Lokalizacja" menu głównego.
  2. W sekcji "Export języka" wyvierz język, w którym dokonałeś modyfikacji, następnie wybierz nazwę Twojego aktualnego szablonu i wciśnij przycisk "Eksportuj".
  3. Zapisz pobrany plik w folderze "prestashop-prod" na pulpicie Twojego komputera. 

Całą procedurę powtórz dla każdego języka, który został przez Ciebie dodany, zmodyfikowany, albo poprawiony. 

Sprawdź zawartość folderu zawierającego Twoje kopie bezpieczeństwa

Czy folder "prestashop-prod" zawiera...

  • ...kompletną i aktualną kopię wszystkich plików Twojego aktualnego sklepu?
  • ...kompletną i wolną od błędów kopię bazy danych?
  • ...kopię Twoich unikalnych tłumaczeń (opcjonalnie)?

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.

Krok 2 - Przygotuj się na nową wersję

Pobieranie i rozpakowywanie najnowszej wersji PrestaShop

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: przenieś pliki tak, aby folder  /prestashop z archiwum .zip nie znajdował się w folderze "prestashop-prep". Raczej przenieś pliki i foldery, które zawiera, tak aby mieć te same pliki dla folderów "prestashop-prod" oraz "prestashop-prep".

Jeśli jeszcze nie posiadasz narzędzia do rozpakowywania archiwów .zip, możesz pobrać jeden z nich za darmo tutaj: http://www.7-zip.org/.

W folderze "/prestashop-prep" zaznacz folder  "/admin" i nadaj mu tę samą nazwę, którą nosi ten sam folder w wersji produkcyjnej sklepu. Na przykład, jeśli Twój "prestashop-prod"  używa nazwy admin123, nadaj tę samą nazwę folderowi /admin w folderze "prestashop-prep".

Kopiowanie plików zapasowych z "prestashop-prod" do nowego katalogu "prestashop-prep" 

Przyszedł czas, aby skopiować pliki, które są unikalne dla Twojego sklepu produkcyjnego, do katalogów nowej wersji. W praktyce, pomysł polega na zbudowaniu folderu "prestashop-prep", który zawierać będzie najnowszą wersję standardowych plików PrestaShopa oraz wszystkich plików, które stworzyłeś i umieściłeś online odkąd PrestaShop został zainstalowany: obrazki, loga, zdjęcia, tłumaczenia, moduły itp.
To ważny krok, ponieważ pozwala Ci na zachowaniu wszystkich zmian z twojego sklepu.
Nie spiesz się z wykonywaniem niniejszych poleceń.Od tej pory będziesz przeglądać pliki i foldery, ktore były przechowywane w folderze "prestashop-prod", w tym samym porządku w folderze "prestashop-prep".
Za każdym razem, gdy system zapyta Cię czy zastąpić pliki, odpowiedz "tak".

 

Następujące foldery muszą zostać skopiowane z katalogu "prestashop-prod" do niedawno rozpakowanego folderu "prestashop-prep":

  • /mails. Zawiera szablony maili, także te, które zmodyfikowałeś.
    Jeśłi nigdy nie dokonałeś żadnej modyfikacji szablonu maila, nie przejmuj się tym folderem.
  • /img. Zawiera logo i  wszystkie obrazki sklepu (kategorie, produkty itp.). Zadbaj w szczególności o poniższe pliki i foldery:
    • logo.jpg - logo sklepu
    • favicon.ico - favicon sklepu
    • logo_stores.gif - Logo sklepu na mapie
    • /c - obrazy kategorii
    • /cms - obrazki stron CMS
    • /co - kolory atrybutów
    • /m - logo producentów 
    • /p - zdjęcia produktów
    • /scenes - zdjęcia mapy kategorii
    • /st - zdjęcia sklepów fizycznych 
    • /su - logo Twoich dostawców
    • ...po prostu skopiuj wszystkie katalogi oprócz  /img/admin oraz /img/jquery-ui.
  • /modules. Skopiuj tylko te moduły, które zainstalowałeś odkąd zainstalowałeś PrestaShopa po praz pierwszy (a które nie były częścią domyślnej instalacji).
    • Niektóre z tych modułów mogą nie być aktualnie włączone, albo nawet zainstalowane: to do Ciebie należy, czy są one nadal użyteczne dla Ciebie i zasługują na skopiowanie ich do zaktualizowanej wersji.
    • Ponadto zwróć uwagę, że prawdopodobnie, będziesz musiał zaktualizować moduły, które nie zostały stworzone z myślą o nowej wersji PrestaShopa.
  • /themes/themeName. Skopiuj Twój aktualny szablon.
    • Jeśli korzystasz z domyślnego (niezmienionego) szablonu PrestaShopa, nie kopiuj jego katalogu (/themes/prestashop) : musisz skorzystać z tego w nowej wersji (/themes/default).
    • Jeśli dokonałeś zmian w domyślnym szablonie, skopiuj jego katalog.
  • /download oraz /upload. Zawierają wszystkie pliki możliwe do pobrania przy produkcie, jego załączniki itp. Jeśli nie korzystasz z tych funkcjonalności, nie kopiuj tych katalogów.
  • /classes. Jeśli dodałeś, zmieniłeś klasy, skopiuj je do nowego katalogu /classes.

    Podczas aktualizacji z wersji poniżej 1.4, musisz ręcznie edytować klasy, które zmieniłeś. Nie musisz zmieniać klas, w których nie dokonano zmian. Aby wszystko działało prawidłowo w najnowszej wersji PrestaShopa, wszystkie te pliki klas muszą zawierać końcówkę "Core". Nie rób tego, jeśli nie jesteś zaznajomiony z PHP.

    Oto jak powinieneś zmienić pliki klas, które chcesz zatrzymać:

    1. Skopiuj pliki klas, w których dokonałeś zmian do katalogu /classes w "prestashop-prep".
    2. Otwórz każdy plik klasy i znajdź te, które nie posiadają końcówki Core. Jeśli aktualizujesz z wersji 1.4.x, nie powinieneś mieć żadnej, (oprócz spersonalizowanych klas).
    3. Zmień nazwę klasy, dodając końcówkę "Core", na przykład: "MyClass" stanie się "MyClassCore".
      Zmień nazwę tylko w klasie PHP, nie nazwę samego pliku!
    4. Jeśli wszystkie pliki mają już końcówkę "Core" w ich nazwie klasy (jak "class AttributeCore extends ObjectModel"), to nie musisz już zmieniać niczego.
    5. Zachowaj wszystkie edytowane pliki.
  • /config. Musisz skopiować tylko jeden plik, ale najważniejszy:  settings.inc.php .
  • /translations - jeśli korzystasz z innego języka, niż te dostępne w domyślnej instalacji , musisz skopiować katalog języka do kataogu  w nowej instalacji. Jeśli Ci się to nie uda, to aktualizacja nie będzie działać prawidłowo.

Twój katalog "prestashop-prep" jest gotowy. Nie dotykaj go więcej, od tej pory będziemy pracować tylko na jego kopii.

Przenoszenie katalogu "prestashop-prep" na Twój lokalny serwer

Katalog "prestashop-prep", który pierwotnie rozpakowałeś z archiwum najnowszej wersji PrestaShopa, zawiera obecnie wszystkie Twoje modyfikacje z katalogu "prestashop-prod"(czyli cały Twój sklep, który jest online, ale działa w trybie konserwacji) W tym kolejnym kroku, skopiujesz ten katalog na swój serwer lokalny, aby sprawdzić czy aktualizacja funkcjonuje bez żadnych problemów.

Uruchom serwer lokalny(WAMP, XAMPP, EasyPHP, MAMP albo jakikolwiek inny), i upewnij się, że Apache i MySQL działają.

Podstawowym założeniem jest sprawdzenie lokalnie, czy sklep może zostać zaktualizowany bez problemów na serwerze lokalnym, aby zminimalizować ryzyko błędów podczas uruchomiania aktualizacji Twojego sklepu. Dlatego powinieneś odtworzyć środowisko serwera, na którym znajduje się sklep, na serwerze lokalnym, aby zminimalizować ryzyko nieprzyjemnych niespodzianek podczas aktualizacji online.

Skontaktuj się z administracją hostingu, aby uzyskać informacje o konfiguracjach Apache, PHP i MySQL na Twoim serwerze, oraz edytuj odpowiednio pliki  httpd.conf (Apache), php.ini (PHP) oraz my.ini (MySQL), jeśli możesz. W przypadku ekstremalnym będziesz musiał zmienić wersję każdego z komponentów lokalnego serwera, aby zduplikować swój serwer online.

Gdy to zrobisz, zresetuj serwer lokalny, aby zmiany zostały wprowadzone.

Jeśli nie możesz edytować plików konfiguracji na lokalnym serwerze, to pamiętaj, że różnice pomiędzy serwerem online, a lokalnym mogą mieć ogromny wpływ na aktualizację, ponieważ to co funkcjonuje poprawnie w jednym środowisku nie musi działać poprawnie w innym. Jak na przykład limity pamięci i ścieżki absolutne zamiast relatywne.

Otwórz katalog webowy na twoim serwerze lokalnym (/htdocs/www/web albo inna nazwa w zależności od serwera),  i skopiuj katalog "prestashop-prep" do niego.

Caution

Nie przenoś po prostu swojego katalogu "prestashop-prep" do katalogu webowego serwera lokalnego!

Upewnij się że zrobiłeś jego kopię, aby pozostawić oryginał nietkniętym.

W ten sposób, w przypadku problemu z aktualizacją lokalną, będziesz w stanie otworzyć katalog "prestashop-prep" i dokonać niezbędnych zmian, zanim skopiujesz go na serwer lokalny i i spróbujesz zaktualizować sklep ponownie.

Umieść katalog "prestashop-prep" w katalogu webowym na lokalnym serwerze.

Odtwarzanie lokalnie produkcyjnej bazy danych

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:

  1. Open the phpMyAdmin tool, which should be available on your local server. Most of the time, it is located at http://127.0.0.1/phpmyadmin, or sometimes http://127.0.0.1/mysql.
  2. If it is not already the case, create a new database especially for this project. Give it a distinctive name, like "prestashop_update" or even the database name for your production store, for instance.
    If you have already created a database for a previous local update test, just delete all of its tables.
  3. Open de database, and click on the "Import" tab, located at the top of the screen.
  4. 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_limitvalue 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 .sql the file using a Zip tool, such as http://www.7-zip.org/. phpMyAdmin should accept .sql.zip files, and will take care of uncompressing the file before importing the data.

  5. Click on the "Go" button to import the SQL file's content.

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.

Checking everything before going any further

Did you follow these steps?

  1. You have downloaded the latest version of PrestaShop.
  2. You have unzipped that version, and have stored its files in a new local "prestashop-prep" folder.
  3. You have copied your custom files from your local back up ("prestashop-prod") into that "prestashop-prep" folder.
  4. You have copied the "prestashop-prep" folder in the web folder on your local server.
  5. You have imported the data from your production store in your local MySQL server.
  6. You have put the correct local database information in the configuration file.

If you did do all that, then you can continue to Step 3.

Step 3 – Starting the Update

Launching the update script

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 settings.inc.php file so that you won't have to edit it again), edit the content of the "prestashop-prep" folder according to the issue you discovered, and copy "prestashop-prep" again into the local server's web folder.

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.

Finishing the local update

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:

  • The /install folder, which contains the install script.
  • The README files, which contain information about the PrestaShop install.
  • The 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 /prestashop-prep folder.

Go to your "prestashop-prod" folder's /themes folder, and copy your theme's folder to the /themes in "pretashop-prep". Reload the page to see the maintenance page – or your theme.

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.

If the update fails

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 /config/settings.inc.php files.

6

The configuration file cannot be written.

Edit the access rights for the /config/settings.inc.php files.

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.
If you were trying to update to the latest version of PrestaShop, then do not bother updating. If not, download the latest version.

This error can also be triggered when you are starting the update test again, after having already tried once. If that's the case, check that the administration does work and indicates the latest version number. If not, use your old backups (files and database) to start anew, and go back to step 1 of the update process.

29

There is no older version.

Have you copied the config/settings.inc.php file as is?

31

SQL update files cannot be found.

Check that the /install/upgrade/sql folder is not empty. If it is, get the SQL update files from the archive of the latest version.

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 /install/upgrade/sql folder, and can be read.

34

Internal SQL error.

The SQL update files might be corrupted. Download the new version's archive again, and use its files from the /install/upgrade/sql.

35

Cache is enabled.

Disable PrestaShop's cache before you start the update script: open the config/settings.inc.php file, and check that define('PS_CACHE_ENABLED', '0'); is indeed set to 0.

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:

  • Delete all the files from the local web folder, and replace them with those from the "prestashop-prep" folder, which are pristine because they were kept untouched.
  • Delete all the tables from the test database, and replace them with those from the original installation.

Step 4 - QA and Testing

Import your Translations

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.

Tests to be done on your local test store

To make sure that everything is working properly on your updated local store, you should perform a few tests:

  • Make sure all page types load properly (home, categories, products, comparison, CMS, etc.)
  • Create a customer account
  • Place an order (add to cart and order)
  • Verify that payments work properly (credit card, PayPal, etc.)
  • In the Back Office, check that the order was properly placed and received
  • Send an email from the contact page or "Forgot my password"
  • Check the resulting invoice
  • Check all the modules that you have activated

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:

  1. Edit the content of the "pretashop-prep" folder in order to correct the issues (missing files, wrong configuration, etc.),
  2. Restart the process for the local update:
    1. Delete the test sub-folder in the local web folder,
    2. Delete the MySQL tables for your test update,
    3. Copy the "prestashop-prep" files in the local web folder,
    4. Import the backup SQL file from "prestashop-prod" into the local MySQL server,
    5. Restart the update script.

If every test is successful, congratulations! Proceed to step 5.

Step 5 - Starting the Update on your production store

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:

  1. Using your FTP client, replace the files in your online store with those from your "prestashop-prep" folder.
    You should have nothing to worry about, because all your files have been backed up at the beginning of the process in the "prestashop-prod" folder, so you can return to this backup at any time. Ditto for your database, which has also been saved in the "prestashop-prod" folder as .sql file.
  2. Run the update script on your production shop, by accessing it using your browser. In version 1.6, the script is located at /install/upgrade/upgrade.php.
  3. Check all settings before updating: Follow the on-screen instructions and make sure that your server meets the technical requirements of the new version.
  4. End of update: Once the update is complete, remove the /install and browse your front office and your back office to make sure everything works.

Step 6 - QA and Testing

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.

Import your translations

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.

Check the main Domain Name

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":

  • "Shop domain": This should be the domain name to which you are currently connected. Otherwise, all your links will be invalid and will use an incorrect domain name.
  • "Base URI": This folder should be the one that you have transferred onto your FTP server; in this tutorial, it would be /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:

  1. Open the database for your production store,
  2. Open the ps_shop_url,
  3. Edit the domaindomain_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 /config/settings.inc.php file from version 1.6, but in the database.

Therefore, you can open the /config/settings.inc.php and delete the define('_PS_BASE_URI_', '/le_chemin_de_la_boutique/'); if the update hasn't taken care of that.

Tests to perform on your updated production store

You must make sure that everything is working properly on your update store. These are a few tests to perform:

  • Make sure all page types load properly (home, categories, products, comparison, CMS, etc.)
  • Create a customer account
  • Place an order (add to cart and order)
  • Verify that payments work properly (credit card, PayPal, etc.)
  • In the Back Office, check that the order was properly placed and received
  • Send an email from the contact page or "Forgot my password"
  • Check the resulting invoice
  • Check all the modules that you have activated

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:

  1. Edit the content of the "pretashop-prep" folder in order to correct the issues (missing files, wrong configuration, etc.),
  2. Restart the process for the local update:
    1. Delete the test sub-folder in the local web folder,
    2. Delete the MySQL tables for your test update,
    3. Copy the "prestashop-prep" files in the local web folder,
    4. Import the backup SQL file from "prestashop-prod" into the local MySQL server,
    5. Restart the update script.

If every test is successful, congratulations!

Step 7 - Activating your store

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).

  • No labels