36 votes
Accepted

Cannot update: "No available releases found"

Solution 1: SQL Query While checking updates Drupal creates some rows inside the key_value table which should be deleted after checking is complete but looks like they doesn't for some reason. So ...
madpoet's user avatar
  • 675
23 votes

reseting the hook_update_n status of a module

FYI, in Drupal 8, the system table has been removed, and this information is now stored in the key_value table. UPDATE key_value SET value='i:8000;' WHERE collection = 'system.schema' AND name = '...
micahw156's user avatar
  • 331
19 votes

How do I update the configuration of a module?

I've found this Gist on GitHub, which reverts/reloads given module's configuration using drush: drush cim -y --partial --source=modules/path/to/module/config/install/
Elin Y.'s user avatar
  • 7,339
19 votes
Accepted

What is the purpose of drush entity-updates?

drush entity-updates is a developer tool. If you change entity/field definitions in your custom module you can quickly apply this. In production this should not happen. If you update a module between ...
4uk4's user avatar
  • 99.3k
17 votes
Accepted

How can I update Drupal core and all modules / themes in one go from the command line?

Assuming you are using Composer to maintain your Drupal 8 installation, you can use the following command to update core and all modules (and dependencies). composer update drupal/* --with-...
hansfn's user avatar
  • 1,663
15 votes
Accepted

How to rerun hook_post_update_NAME()

"post_update" hooks that have been run are stored in the database, in the key_value table, post_update collection, but the data is serialized and awkward to update directly. I used some of the ...
bryanbraun's user avatar
14 votes

How do I update the configuration of a module?

As I landed on this question as well but did not really find the correct answer for my situation here, I'd like to add another answer. Please note: Anti-pattern ahead! Use case When we're ...
Ambidex's user avatar
  • 899
13 votes
Accepted

What order should configuration import and module updates be run?

Updates must be run before configuration is imported A pending issue against core will ensure that the code and schema versions match before allowing configuration to be imported. Problems with ...
gapple's user avatar
  • 1,564
11 votes
Accepted

Updating core to a newer version

Download drupal 8.0.2 Extract Copy the core directory into your project. Copy the .htaccess , composer.lock & composer.json files to your project Copy the vendor directory to your project Go to ...
Eyal's user avatar
  • 3,246
11 votes
Accepted

programmatically enable and disable theme from update hook

Use the theme installer service to enable and disable themes . Install a list of themes: \Drupal::service('theme_installer')->install(['mytheme']); Uninstall a list of themes: \Drupal::service('...
4uk4's user avatar
  • 99.3k
10 votes

composer update drupal/drupal does not work : Nothing to install or update

Finally, i could update with these modifications. Step 1, optional in case your composer.jsoncontains this. If it is ok, apply step 2 add "require": { --- "drupal/core": "~8.5" ...
Sébastien Gicquel's user avatar
8 votes
Accepted

How do I get the last available hook_update_N() for a module?

They're in key/value storage, which in the database would be the key_value table. Look for entries with a collection of system.schema, and a name matching the machine name of the module you're ...
Clive's user avatar
  • 167k
8 votes

Is possible to update a project that has been installed from the archive file?

I got this working, I was very close but removing /vendor and composer.lock was what helped in the end. Here are the steps from the top: add the line "drupal/core": "~8.1" to the 'require' ...
RominRonin's user avatar
8 votes

How can I install a specific core version?

Now Drupal recommended project supports version as command line option. If you want to install version 8.8.5 via Composer then command will like as shown below. composer create-project drupal/...
Vinod Singh's user avatar
7 votes

Updating core to a newer version

Instead on doing such long and hectic procedure it better to learn and update drupal 8 core through DRUSH. 1. Install Drush for Drupal8. 2. Put your site in maintenance mode through drush. ...
Rahul's user avatar
  • 328
7 votes
Accepted

Putting new configuration files in module hook_update_N upgrade?

You can parse and load the yaml file yourself, something like redirect_update_8003: use Symfony\Component\Yaml\Yaml; /** * Creates the new default redirect view. */ function redirect_update_8103() ...
Berdir's user avatar
  • 83.1k
7 votes

How to compare the already saved value of node and updated value?

node_save(), which invokes hook_node_update(), contains the following code. // Load the stored entity, if any. if (!empty($node->nid) && !isset($node->original)) { $node->original =...
apaderno's user avatar
  • 97.4k
7 votes

Which table stores info about hook_update_N?

The schema version for the update hook is stored in the key_value table. You can set it with the global function drupal_set_installed_schema_version($module, $version). For example: ...
4uk4's user avatar
  • 99.3k
7 votes

How to rerun hook_post_update_NAME()

Here is an example you can use from the command line with drush php-eval: drush php:eval '$update_hook_name = "<my_hook_post_update_name>"; $key_value = \Drupal::keyValue("...
Jason Yarrington's user avatar
6 votes
Accepted

What will happen if a custom module has the same name as a contrib module?

I write a custom module named 'views' and do not have the contrib module 'views' enabled, will the update manager attempt to update my custom module according to the contrib project status? No it won'...
Clive's user avatar
  • 167k
6 votes
Accepted

How do I update core to 8.4?

Make a database backup. Make a Drupal code source backup. I had to know which drush I use: $ drush version Drush Version : 8.1.9 which isn't good for me. I had to find out whether it is a local ...
Zoltán Süle's user avatar
6 votes

How can I install a specific core version?

Create drupal-project with --no-install option: composer create-project drupal-composer/drupal-project:8.x-dev my_site_name_dir --no-interaction --no-install Change directories to my_site_name_dir ...
4uk4's user avatar
  • 99.3k
6 votes
Accepted

How the handle an override of the schema of a field type

You have to write an update function that changes those fields live in your database so they match the new definition. Time ago, this was done using the drush entity-updates command. However, this was ...
sanzante's user avatar
  • 6,981
5 votes
Accepted

After upgrading, no content types under node/add

I finally managed to fix this by accident while trying to fix a different issue. Following this post: https://drupal.stackexchange.com/a/82222/25238 Similar to https://www.drupal.org/node/997444 I ...
Michael's user avatar
  • 381
5 votes
Accepted

Update.php does nothing

Drupal 8 requires PHP 5.5.9. If you are using PHP 5.2.9, it doesn't recognize as valid a line like use Drupal\Core\DrupalKernel; since namespaces were introduced in PHP 5.3. If you were already ...
apaderno's user avatar
  • 97.4k
5 votes

How to get the installed version of a module?

You can use the global function drupal_get_installed_schema_version(): $update_hook_count = drupal_get_installed_schema_version('mymodule');
4uk4's user avatar
  • 99.3k
5 votes

Running drush up to several sites folders at once

First off, look to the trivial solution: #!/bin/bash drush @site1 up -y --no-backup drush @site2 up -y --no-backup You don't need to install Ansible to start automating; simple bash scripts can be ...
greg_1_anderson's user avatar
5 votes
Accepted

Error after updating

Execute drush entity-updates. As usual, test this on non-production system.
cilefen's user avatar
  • 5,844
5 votes

Which table stores info about hook_update_N?

To find the row in the key_value table where the value (value column) is stored for the number in hook_update_N, look for the module machine name in the name column. For example to get the N value ...
Jon's user avatar
  • 151
5 votes

Cannot update: "No available releases found"

drush sql-query "DELETE FROM key_value WHERE collection='update_fetch_task'" using drush Fixed for me
Mohamed Osama Gbril's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible