Drupal: Difference between revisions
Tag: Undo |
|||
| Line 45: | Line 45: | ||
==== Capturing Server Resources Before Your Next Rebuild ==== | ==== Capturing Server Resources Before Your Next Rebuild ==== | ||
After installing Drupal on NixOS using the admin UI, you will want to export the MYSQL database of your website and export the Drupal site configuration. Doing both steps makes it possible to implement continuous integration and continuous delivery on the environment you just created. | After installing Drupal on NixOS using the admin UI, you will want to export the MYSQL database of your website and export the Drupal site configuration. Doing both steps makes it possible to implement continuous integration and continuous delivery on the environment you just created. | ||
Backing up your Drupal configuration (with git or similar) and database is recommended, especially after a successful install of a new Drupal instance.<blockquote>'''Warning:''' When using a Drupal package that has an existing set of configuration in the config sync directory (or using the configRoot option in nix), it is '''mandatory''' to import a working SQL database from another working installation. Failing to do so will cause your website to not function correctly. | |||
The advised development workflow for starting a Drupal website (or websites) on NixOS is to do the following | |||
# Install a new instance of Drupal on NixOS. The configRoot option should be disabled. | |||
# Once the installation is complete, export the database, and export the configuration. See the sections below on the recommended way to do both of these tasks. | |||
# Integrate the contents of the config sync directory (located, by default, at /var/lib/drupal/<hostname>/config) back into your upstream Drupal package. | |||
# During your next rebuild, make sure to import any configuration changes by visiting '''Manage > Configuration > Development > Configuration synchronization''' in the Drupal admin. | |||
# If you intend on deploying this exact same site elsewhere, take regular backups of your database. | |||
# Deploy your saved database and the source code into a new instance of Drupal on NixOS at the same time to avoid a chicken-and-egg scenario. | |||
</blockquote> | |||
===== Exporting The Database ===== | ===== Exporting The Database ===== | ||
| Line 82: | Line 94: | ||
services.drupal.sites."my-host-name.local".configSyncDir = "/var/lib/drupal/my-host-name.local/config/sync"; | services.drupal.sites."my-host-name.local".configSyncDir = "/var/lib/drupal/my-host-name.local/config/sync"; | ||
</syntaxhighlight>If you use the default setting for <code>configSyncDir</code>, you can simply add the first line of code and substitue your hostname. | </syntaxhighlight>If you use the default setting for <code>configSyncDir</code>, you can simply add the first line of code and substitue your hostname. | ||
== Configuration == | == Configuration == | ||