Skip to content

Latest commit

 

History

History
109 lines (78 loc) · 7.19 KB

UPGRADE-v7.0.0-alpha5.md

File metadata and controls

109 lines (78 loc) · 7.19 KB

This guide contains instructions to upgrade from version v7.0.0-alpha4 to v7.0.0-alpha5.

Before you start, don't forget to take a look at general instructions about upgrading. There you can find links to upgrade notes for other versions too.

Note: instructions marked as "low priority" are not vital, however, we recommend to perform them as well during upgrading as it might ease your work in the future.

  • for product search via Elasticsearch, you'll have to:
    • check changes in the docker-compose.yml template you used and replicate them, there is a new container with Elasticsearch
      • since docker-compose.yml is not versioned, apply changes also in your docker-compose.yml.dist templates so it is easier to upgrade for your team members or for server upgrade
    • since the fully installed and ready Microservice Product Search is a necessary condition for the Shopsys Framework to run, the installation procedure of this microservice is a part of Shopsys Framework installation guide
    • run docker-compose up -d
    • update composer dependencies composer update
    • create Elasticsearch indexes by running php phing elasticsearch-indexes-create
    • export products into Elasticsearch by php phing elasticsearch-products-export
  • ProductFormType is extensible now #375. If you extended the product form, you have to:
    • move form parts into right subsections, eg. this change on demoshop
    • if you don't have custom rendering, remove your template for form
    • if you have custom rendering, change rendering of these parts as they are now in subsections
    • as the form changed structure, you have to also fix tests. see this change on demoshop
      • form fields changed names and also ids

PostgreSQL upgrade:

We decided to move onto a newer version of PostgreSQL.

These steps are for migrating your data onto newer version of postgres and are inspired by official documentation:

If you are running your project natively then just follow official instructions, if you are using docker infrastructure you can follow steps written below.

  1. create a backup of your database by executing::

    docker exec -it shopsys-framework-postgres pg_dumpall > backupfile

  2. apply changes in docker-compose.yml, you can find them in a new version of docker-compose.yml.dist templates

    Note: select correct docker-compose according to your operating system

    since docker-compose.yml is not versioned, apply changes also in your docker-compose.yml.dist templates so it is easier to upgrade for your team members or for server upgrade

  3. update version of database_server_version from 9.5 to 10.5 in your parameters.yml

  4. stop containers and delete old data:

    docker-compose down

    rm -rf <project-root-path>/var/postgres-data/*

  5. use a new version of php-fpm container:

    curl -L https://github.com/shopsys/shopsys/raw/v7.0.0-alpha5/project-base/docker/php-fpm/Dockerfile --output docker/php-fpm/Dockerfile

    docker-compose build php-fpm

  6. start new docker-compose stack with newer version of postgres by just recreating your containers:

    docker-compose up -d --force-recreate

  7. copy backup into postgres container root folder

    docker cp backupfile shopsys-framework-postgres:/

  8. restore you data:

    docker exec -it shopsys-framework-postgres psql -d postgres -f backupfile

  9. delete backup file:

    docker exec -it shopsys-framework-postgres rm backupfile

  10. recreate collations:

    docker exec shopsys-framework-php-fpm ./phing db-create test-db-create

  • added Microservice Product Search
    • check changes in the docker-compose.yml template you used and replicate them, there is a new container microservice-product-search
      • since docker-compose.yml is not versioned, apply changes also in your docker-compose.yml.dist templates so it is easier to upgrade for your team members or for server upgrade
      • follow installation guide to install microservice or use docker microservice image that require no installation
    • into parameters.yml.dist add a new parameter microservice_product_search_url:
      • microservice_product_search_url: 'http://microservice-product-search:8000'
      • and add it also into parameters.yml
    • modify a configuration in services.yml for:
      • Shopsys\FrameworkBundle\Model\Product\Search\ProductSearchRepository
      • shopsys.microservice_client.product_search
    • remove a configuration in services.yml for:
      • Shopsys\FrameworkBundle\Model\Product\Search\ElasticsearchSearchClient
      • Shopsys\FrameworkBundle\Model\Product\Search\CachedSearchClient
      • Shopsys\FrameworkBundle\Model\Product\Search\SearchClient
  • (low priority) standardize indentation in your yaml files
    • you can find yaml files with wrong indentation with regexp ^( {4})* {1,3}[^ ]
  • (low priority) we added a new phing target that checks availabitliy of microservices. Feel free to include this target into your build process.
  • add new themes to configuration app/config/config.yml, path twig.form_themes:
        - '@ShopsysFramework/Admin/Form/warningMessage.html.twig'
        - '@ShopsysFramework/Admin/Form/displayOnlyUrl.html.twig'
        - '@ShopsysFramework/Admin/Form/localizedFullWidth.html.twig'
        - '@ShopsysFramework/Admin/Form/productParameterValue.html.twig'
        - '@ShopsysFramework/Admin/Form/productCalculatedPrices.html.twig'