eZ Platform Discussions

[eZ Launchpad] Upgrate from 2.1 to 2.2

version22

#1

Bonjour,

I want to upgrade from version 2.1 to version 2.2.

So I started the following procedure:
https://doc.ezplatform.com/en/latest/releases/updating_ez_platform/

But my project is managed by eZ Launchpad.
https://ezsystems.github.io/launchpad/#deploy-psh

So in step 1.3 I find myself with eZ Platform 2.2 at the root of my repository while it must be in /ezpaltform

# Before git pull ezplatform-ee refs/tags/v2.2.0
remy ~/docker/myproject [root of my git project] $ ls
data  doc  ezplatform  provisioning  README.md  scripts

remy ~/docker/myproject $ git remote
ezplatform-ee
origin
platform

Is there a particular procedure to follow with eZ Launchpad?
Maybe a command included in eZ Launchpad?


#2

There is a command

docker:update Update to last images.

But I don’t know what it’s for.


#3

@Plopix à écrit :
https://ezcommunity.slack.com/archives/C5FM0S73M/p1530307744000190

my best way is a rsync then I compare
I clone ezplatform somewhere, then I rsync with a lot of exclude then I compare and merge and then follow instructions if scripts have to be ran
rsync -avzcCn --delete --exclude="web/bundles/" --exclude="web/css/" --exclude="web/js/" --exclude="vendor/" --exclude="web/var/" --exclude="var/" --exclude="src/" --exclude="bin/" --exclude="tests/" --exclude="app/Resources/" ./ ../ezplatform/

for instance
from rc1 to 2.2.0 stable that is what I have done


#4

I took the risk…

I hope I haven’t screwed up my instance again…

remy ~/docker/myproject $ ez docker:update

Pulling engine … done
Pulling nginx … done
Pulling db … done
Pulling varnish … done
Pulling solr …
Pulling solr … done
Pulling adminer … done
Pulling redis … done
Pulling redisadmin … done
Pulling blackfire … done

Building engine
Step 1/6 : FROM plopix/docker-php-ez-engine:7
—> e88b0ebccaa8
Step 2/6 : MAINTAINER Plopix
—> Using cache
—> c7c907e229fe
Step 3/6 : COPY entrypoint.bash /entrypoint.bash
—> Using cache
—> 613fa3e0257e
Step 4/6 : RUN chmod +x /entrypoint.bash
—> Using cache
—> 60a04ea47d6c
Step 5/6 : ENTRYPOINT ["/entrypoint.bash"]
—> Using cache
—> 0f222b6e291b
Step 6/6 : CMD [“php-fpm”]
—> Using cache
—> 2189da5f1057
Successfully built 2189da5f1057
Successfully tagged remymyproject_engine:latest
nginx uses an image, skipping
db uses an image, skipping
varnish uses an image, skipping
solr uses an image, skipping
mailcatcher uses an image, skipping
adminer uses an image, skipping
redis uses an image, skipping
redisadmin uses an image, skipping
blackfire uses an image, skipping
Recreating remymyproject_engine_1 … done
Recreating remymyproject_blackfire_1 … done
Recreating remymyproject_adminer_1 … done
Recreating remymyproject_mailcatcher_1 … done
Recreating remymyproject_db_1 … done
Recreating remymyproject_redisadmin_1 … done
Recreating remymyproject_redis_1 … done
Recreating remymyproject_nginx_1 … done
Recreating remymyproject_solr_1 … done
Recreating remymyproject_varnish_1 … done

WARNING: you don’t have the last image of the PHP ENGINE
TO FIX RUN: ~/ez docker:update
/var/www/html/project/composer_install.bash: line 23: /usr/local/bin/composer: No such file or directory
OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused “exec: “/usr/local/bin/composer”: stat /usr/local/bin/composer: no such file or directory”: unknown

In Process.php line 239:

The command "docker-compose -p remymyproject -f /home/remy/docker/myproject/provisioning/dev/docker-compose.yml exec --user www-data engine /usr/local/bin/composer config --global http-basic.updates.ez.no 97b003579dbe7bd14e5204ffaea49cb6 uMJXpQeCO2KBBS8Dzg8n" failed
.

Exit Code: 126(Invoked command cannot execute)


#5

All right. Apparently it still works. But that doesn’t seem to be the solution to my problem.

I’ll test the @Plopix technique.


#6

Docker:update is the ezlaunchpad command to update the docker containers to the latest version of the container image. Not update ezplatform.

I also use ezlaunchpad and the rsync method isn’t too appealing. I coppied my ezplatform folder from my project to another sandbox folder and set up the remote git repo and did the merge following the steps provided by ez. I then went into each file that had a conflict and merged everything manually. I’m not done yet to say if this worked or not. I had originally modified the schema by removing eng-gb with eng-us but going to set that back. My plan is to run the new ezplatform command to install a new database from scratch to get back to a stable installation of ezplatform.


#7

Salut @travis.raup.

Thank you for that clarification.

The technique you propose also seems interesting.
Feel free to share your results with us.

For my part here is where I am:

Upgrade to 2.2

Recovery of the 2.2 in a new project

mkdir ~/docker/22
cd ~/docker/22
ez platformsh:deploy

rsync with excludes

cd ~/docker
rsync -avzcC --dry-run --delete \
    --exclude="web/bundles/" \
    --exclude="web/css/" \
    --exclude="web/js/" \
    --exclude="vendor/" \
    --exclude="web/var/" \
    --exclude="var/" \
    --exclude="src/" \
    --exclude="bin/" \
    --exclude="tests/" \
    --exclude="app/Resources/" \
    ~/docker/22/ezplatform/ ~/docker/my_client/ezplatform/

‘Merges’ management

With phpstorm. Here are some specificities of my configuration

config.yml

parameters:
    locale: fr

ezplatform.yml

ezpublish:
    system:
        default:
            languages: [fre-FR, eng-GB]

Connect to engine

The rest happens in the container

ez docker:enter

Reinstalling to composer in the container then composer update

php composer.phar update --no-scripts
php composer.phar update

You have to do several php composer.phar update until you have fixed all the errors

There is no extension able to load the configuration for “ezstudioui” (in /var/www/html/project/ezplatform/src/MyClient/MyProjectBundle/Resources/config/config.yml).

The service “my_client.block.random” has a dependency on a non-existent service “ezpublish.landing_page.block_definition_attribute.factory”.

Applying the mysql patch

mysql -u root -pezplatform --host db ezplatform < vendor/ezsystems/ezpublish-kernel/data/update/mysql/dbupdate-7.1.0-to-7.2.0.sql

ERROR 1050 (42S01) at line 103: Table ‘eznotification’ already exists

I run the last two queries of the dbupdate-7.1.0-to-7.2.0.sql file manually:

mysql -u root -pezplatform --host db ezplatform
CREATE INDEX `ezcontentobject_tree_contentobject_id_path_string` ON `ezcontentobject_tree` (`path_string`, `contentobject_id`);
CREATE INDEX `ezcontentobject_section` ON `ezcontentobject` (`section_id`);

Site Access Test

http://localhost:35080/

An exception occurred while executing 'SELECT id, layout, content_id, version_no, language_code FROM ezpage_pages WHERE (content_id = ?) AND (version_no = ?) AND (language_code = ?)' with params [52, 1, "eng-GB"]:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ezplatform.ezpage_pages' doesn’t exist

Some pages of the BO seem to work but access to the landing_page poses the same problem.


I’m done for today.


#8

Ping @Plopix, maybe you can share some advise on this topic?


#9

Well, I recreated the tables that I missed by hand…

SQL requests from :
vendor/ezsystems/ezplatform-ee-installer/Resources/sql/schema.sql
vendor/ezsystems/ezplatform-ee-installer/Resources/sql/cleandata.sql

CREATE TABLE `ezpage_attributes` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `value` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `ezpage_blocks` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `type` varchar(255) NOT NULL DEFAULT '',
  `view` varchar(255) NOT NULL DEFAULT '',
  `name` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `ezpage_blocks_design` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `block_id` INT(11) NOT NULL,
  `style` TEXT DEFAULT NULL,
  `compiled` TEXT DEFAULT NULL,
  `class` VARCHAR(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `ezpage_blocks_visibility` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `block_id` INT(11) NOT NULL,
  `since` INT(11) DEFAULT NULL,
  `till` INT(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `ezpage_map_attributes_blocks` (
  `attribute_id` int(11) NOT NULL,
  `block_id` int(11) NOT NULL,
  PRIMARY KEY (`attribute_id`,`block_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `ezpage_map_blocks_zones` (
  `block_id` int(11) NOT NULL,
  `zone_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `ezpage_map_zones_pages` (
  `zone_id` int(11) NOT NULL,
  `page_id` int(11) NOT NULL,
  PRIMARY KEY (`zone_id`,`page_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `ezpage_pages` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `version_no` int(11) unsigned NOT NULL,
  `content_id` int(11) NOT NULL,
  `language_code` varchar(255) NOT NULL DEFAULT '',
  `layout` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `ezpage_zones` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

INSERT INTO `ezpage_attributes` (`id`, `name`, `value`)
VALUES (1,'content','<h1>eZ Studio</h1> <p>This is the clean install coming with eZ Studio. Now you can start creating your own design.</p>');

INSERT INTO `ezpage_blocks` (`id`, `type`, `view`, `name`)
VALUES (1,'tag','default','Tag');

INSERT INTO `ezpage_map_attributes_blocks` (`attribute_id`, `block_id`)
VALUES (1,1);

INSERT INTO `ezpage_map_blocks_zones` (`block_id`, `zone_id`)
VALUES (1,1);

INSERT INTO `ezpage_map_zones_pages` (`zone_id`, `page_id`)
VALUES (1,1);

INSERT INTO `ezpage_pages` (`id`, `version_no`, `content_id`, `language_code`, `layout`)
VALUES (1,1,52,'eng-GB','default');

INSERT INTO `ezpage_zones` (`id`, `name`)
VALUES (1,'default');

I finally arrive on a last error:

Unknown “multidomain_access” function.

Et ça marche !