Skip to content

Migrate from version 1.x to 2.x

Dionisio edited this page Jan 30, 2025 · 8 revisions

If you are using ce-dev 1.x and you want to migrate to 2.x, there are some previous steps before installing 2.x. Once you complete the following steps, you can continue with the installation process for Linux or Mac, as if your project were newly created.

Destroy current containers

The containers created for your current projects must be destroyed, because ce-dev 2.x uses new Docker images. If you have work in progress, or you need to take a database dump, please save it before destroying.

Now you can destroy the containers with:

cd path/to/your/project
ce-dev stop (to stop running containers)
ce-dev destroy

it will destroy any {project}-x container (e.g: hello-web, hello-db)

Update provision.yml and deploy.yml files

ce-dev 2.x uses ce-provision 2.x and ce-deploy 1.x under the hood.

ce-provision 2.x introduces some significant changes, so we need to apply these changes in the 'ce-dev/ansible/provision.yml' file

Update 'tasks' section in the provision.yml file

ce-provision 2.x categorizes now the roles (e.g, debian/, contrib/). We need to update the 'tasks' section in the 'ce-dev/ansible/provision.yml' to reflect the new structure:

    - import_role:
        name: _init
    - import_role:
        name: _meta/common_base
    - import_role:
        name: debian/mysql_client
    - import_role:
        name: debian/php-cli
    - import_role:
        name: debian/php-fpm
    - import_role:
        name: debian/nginx
    - import_role:
        name: debian/nodejs
    - import_role:
        name: _exit

if you are using any extra roles in your project, please check the new roles structure and include them accordingly

Add new variables in the provision.yml file

We need to include new variables inside the 'vars:' section. These new variables can be added after _env_type for clarity.

    _ce_provision_username: ce-dev
    _venv_path: "/home/ce-dev/ansible"
    _venv_command: /usr/bin/python3 -m venv
    _venv_install_username: ce-dev
    _ce_ansible_timer_name: upgrade_ce_provision_ansible

Vars are now a dictionary, not a list of variables, in provision.yml and deploy.yml

Now the 'vars' section is a dictionary instead of list of variables. it means:

This

  vars:
    - _domain_name: www.hello.local
    - _env_type: dev
    - project_name: hello

becomes

  vars:
    _domain_name: www.hello.local
    _env_type: dev
    project_name: hello

For a full reference of these changes, you can check the current templates for the provision.yml and deploy.yml

Update docker images used

ce-dev 2.x does not use the images 'drupalx-web' and drupalx-db' images anymore.

The web container uses now the docker image 'codeenigma/ce-dev:2.x', and the db container uses the official docker image 'mariadb'.

You have to update the files:

ce-dev/ce-dev.compose.prebuilt.yml
ce-dev/ce-dev.compose.yml

changing the images used:

  web:
    image: 'codeenigma/drupalX-web:latest' or 'codeenigma/ce-dev-1.x:latest'

to

  web:
    image: 'codeenigma/ce-dev:2.x'

and

  db:
    image: 'codeenigma/drupal10-db:latest'

to

  db:
    image: 'mariadb'

Keeping ce-dev 1.x

if you need to keep ce-dev 1.x for some reason, you can rename the current installation before installing the new one. ce-dev is installed in '/opt/ce-dev:

cd /opt
mv ce-dev ce-dev-1

And change the symbolic link:

cd /usr/local/bin
sudo ln -s /opt/ce-dev-1/bin/ce-dev ce-dev-1

From now, ce-dev 1.x is available using 'ce-dev-1' as command