Migrating an existing Drupal project

Step by step instructions#

  1. Make sure you have a clean, up-to-date checkout of your repository.

  2. Create a new feature branch:

    git checkout -b feature/silta
  3. Run the migration script from the project root:
    For Drupal 8+

    curl -s https://raw.githubusercontent.com/wunderio/silta/master/scripts/drupal-migrate.sh | bash

    For Drupal 7 with composer.json run

    curl -s https://raw.githubusercontent.com/wunderio/silta/master/scripts/drupal7-migrate.sh | bash

    Please check troubleshooting for other Drupal 7 cases

    Migration script will create .circleci/config.yml file for CircleCI builds. You might need to adapt branch names or contexts.

    Important
    Add this to silta.yml config if You use Drupal 7

    php:
    drupalCoreVersion: "7"
  4. Read through the output of the script and check for any instructions to perform manual steps.

  5. Check modifications made by the script with git diff. Pay particular attention to code that has been removed, we don't want to lose anything important.

  6. Commit all changes and push them to Github. You should see a build starting automatically on CircleCI: https://circleci.com/gh/wunderio

  7. If the build has errors, try to fix them until the build is green.

    • The build-deploy is the one that matters the most. The validation job can point out issues with your code would prevent it from running. However, you may decide to ignore phpcs errors for now.
    • Have a look at our troubleshooting section.
  8. The last step of the build-deploy contains information on how to access your newly created Silta environment.

    • You should be able to access the site at the given URL with the given basic authentication username and password.
    • The site is not yet installed, we'll do that in the next step.
    • You should also be able to access the environment using the provided SSH instructions.
  9. Upload a database dump using the command provided in CircleCI output. You might need to log in via SSH and clear the caches, import configuration or run updates if your database dump is not in sync with the current codebase. At this point you should have a somewhat functioning environment accessible.

  10. Create a pull request for your feature branch, have a peer review it, and merge it. CircleCI should automatically build the master environment.

  11. Upload the database dump and the files to the master environment. This is the reference environment by default, meaning that new environments will be created with a copy of this content.

  12. Congratulations, your project is now up and running! Please share any issues you had or ideas for improvements.

Drupal 7 migration tips#

Project uses make file for builds#

Have something like this in .circleci/config.yml

codebase-build:
- run:
name: Build from makefile
command: |
composer install
vendor/drush/drush/drush make ~/project/drupal/conf/site.make ~/project/drupal/web/
mkdir -p web/sites/all/modules
cp -r code/modules/custom web/sites/all/modules/

Missing drush#

Add composer.json in Drupal folder

{
"require": {
"drush/drush": "8.*"
},
"extra": {
"installer-paths": {
"web/": ["type:drupal-core"]
}
}
}

And then in .circleci/config.yml add

command: |
composer install