0

I'm developing a store on Drupal 8 with Drupal Commerce 2.1. I'm doing it locally using docker4drupal Docker containers.

I just want to be sure that all my Commerce settings including categories, products and variations will be transferred to the external server during deployment.

Do I need special modules or methods for this except copying the files, database etc?

  • I suggest you to change the word "migration" for "deployment" as it is what you want to do. Migration is more related to migrate a site or commerce store from Drupal 7 or other source to Drupal 8. – Yaazkal Nov 21 '17 at 15:25
1

I don't think you need special modules or methods. Just copying the files and exporting/importing the database is enough. A module like Backup and Migrate can help you on that task but is not a must.

Anyway and as an extra information there are some optional but good practices (tools):

  • Drush: Apart that it can help you on some tasks (clearing cache, enabling modules, etc) it also can help you make a database dump using a command like drush sql-dump > file.sql, then you transfer the database to your server and you can import the database with a command like drush sql-cli < file.sql. If you are using Drupal 8.4.* just make sure to use drush 8.1.12 or higher. Drush can also help you syncronize the local dev site with the production site and even clone the site (more advanced).
  • Git repository: It will help you track custom files and even the configuration using a sync directory. The good thing about this is that you actually don't "transfer" the files, but commit/checkout, it can help you on your development workflow. Some people commit also the drupal or vendor files, other people (like me) just commit the custom files (modules and themes) and commit the composer files (see next).
  • Composer. The good thing about this is that you just transfer the composer.json and composer.lock file and then on the production server just run the command composer install --no-dev and it will download all the drupal/vendor files including contrib, modules, themes, libs, etc that you specified in the composer.json file (so you're actually not transfering the files). Specifically for commerce, the project base of drupal commerce can be a good starting point. Just customize it as you want.

  • Config Split module. It will helps on spliting your configuration so you can have modules that are enabled only locally on your dev environment but not enabled on the production server (like explained here), so in combination with composer you can have downloaded and enabled the devel module locally but not in the production server (as an example).

This answer is not intended to give you a how to on the tools mentioned, but to let you know some tools that exists and can help you in the process of developing drupal sites in general, if them sounds new to you and you are interested in any topics, please look their documentation sites and look around the internet as there are plenty of information, tutorials and videos that will help you consolidate your own workflow.

| improve this answer | |
  • Thank you! I've moved my Commerce site several times without issues. – Max Zviagintsev Jan 5 '18 at 21:46
  • @MaxZviagintsev glad that it helped you. Please mark the answer as "the answer" so the community knows it. – Yaazkal Jan 7 '18 at 0:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.