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

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. 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 categorize 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 some extra role in your project, please check the new [roles structure](https://github.com/codeenigma/ce-provision/tree/2.x/roles) and include it accordingly

### New vars in the provision.yml file

We need to include new vars, inside the 'vars:' area. These new vars 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 items, in provision.yml and deploy.yml

Now the 'vars' section is a dictionary instead of list of vars. 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](https://github.com/codeenigma/ce-dev/blob/2.x/templates/drupal11/ce-dev/ansible/provision.yml.j2) and [deploy.yml](https://github.com/codeenigma/ce-dev/blob/2.x/templates/drupal11/ce-dev/ansible/deploy.yml.j2)

## 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
Clone this wiki locally