Skip to main content
38 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
  • 695
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,349
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
  • 101k
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
16 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
  • 909
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
  • 101k
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

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

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.6k
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
  • 101k
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
  • 101k
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

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.6k
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
  • 101k
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.
mona lisa's user avatar
  • 5,974
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
5 votes

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

It will most likely end up in fatal PHP errors. If you implement a hook that the contrib module also implements you will get a : Cannot redeclare hook() (previously declared in contrib_module....
Robin's user avatar
  • 2,031
5 votes

How do I update core to 8.4?

It's best to update dependencies using composer: composer update drupal/core --with-dependencies Have a look at https://www.drupal.org/docs/8/update/update-procedure-in-drupal-8 Note that you'll ...
mpp's user avatar
  • 401
5 votes

Core update error

If you downloaded Drupal from drupal.org (e.g. via the tarball download link, or with drush dl), then you cannot use Composer to update Drupal core. The steps you are attempting above only work for ...
greg_1_anderson's user avatar
5 votes
Accepted

Site not working after the database update

Add "doctrine/common":">2.8" under conflict in your composer file and then run composer update. "conflict": { "drupal/drupal": "*", "doctrine/common":">2.8" }, See issue: https://www....
albertski's user avatar
  • 3,487
5 votes
Accepted

Is it normal that a site changes to maintenance mode during a module update?

It does look to be normal, yes. Drush's UpdateDBCommands::updateBatch, which is responsible for processing the updates, contains this: batch_set($batch); // See updateFinished() for the restore of ...
Clive's user avatar
  • 167k

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