5

It's easy to update Drupal on the local / remote server using Git.

However, sometimes when I make modifications in the actual module settings or any other settings on my local server – those are recorded in a database and I can't then update them easily on the remote server.

At the moment I just export the whole Drupal database and then overwrite it on the remote server.

But is there any faster / easier Git-like way of doing that?

Maybe a special module? Or a special git-like service for Drupal databases / MySQL databases?

Thank you!

3

The Configuration module is also a way to store configuration in files rather then the DB. You can then sync configurations by importing the configurations to a new system and pressing a button in the admin area to sync configuration with the newly updated files. there also exists a Drush command to invoke the update.

The configuration management module enables the ability to keep track of specific configurations on a Drupal site, provides the ability to move these configurations between different environments (local, dev, qa, prod), and also move configurations between completely different sites (migrate configurations) without the use of modules with all configuration being owned by the site.

I prefer this approach over Features currently, as this way Features does not attempt to take ownership of any of my files -- or rather become a dependency in my system. I believe you can later uninstall the Configuration module for example and not loose your set configuration values.

  • Thank you! And do you know if this module would also save configurations for extra modules that I install? – deemeetree Jan 27 '15 at 0:17
  • No you must hand choose what to save by hand. If your too busy there is a "check all" option. But you should be selective and informed in what your exporting. – tenken Jan 27 '15 at 0:43
2

Have a look at the Features module. The module allows you to save configuration values to code which you can use and enable on the production site. There are plenty of other possibilities how you can save configuration values to code or run from code. It would be a bit too much to tell you everything. But as a start check features and in addition the module Strongarm. There are other modules (cTools exportables for example) which offer you similar possibilities. But with the two mentions here, you can already cover a lot. Another idea to make configurations on a production site without clicking around is to use a custom module and the hook_update_N hook.

Please come back if you have more specific questions.

And last, you should never ever overwrite a production database. Once up and running, it should stay the same (imho).

  • I'll check them both out, thanks! Do you know if these modules actually support configurations of other modules or only the core Drupal setups? – deemeetree Jan 27 '15 at 0:17
  • Not only core. Various modules implement features. Just give it a try. – Lance Jan 27 '15 at 12:04
1

You can try to put as much of your configuration in code instead of putting it in the database. I don't know of an out of the box solution that is working based on what you ask. For your own modules you could use this hook https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_update_N/7 when you change stuff around. This way you can update your DB. It isn't ideal of course.

BTW: Thank god Drupal 8 will fix this problem! So it's just a matter of time before we have full configuration in code that can be version controlled.

  • What if I'm interested to keep track not only of the configuration but also of the actual content this way? Is there any solution for this that you know of? – deemeetree Jan 27 '15 at 0:18
  • There is no out of the box solution for this, not that I know of. You could make something yourself that works for your use case of course. – Fons Vandamme Jan 27 '15 at 11:22

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.