35

If you use Drush you can update all security issues with your site via (this is Core and 3rd party modules): drush up --security-only if you want to see what it will do, but not do any of the actual changes you can issue: drush up --security-only --simulate If you want an easy way to update Drupal Core to the newest release you can use a patch site such as:...


33

You can use drush pm-update to update any module, and add the version information to update to a specific version. For example if you want to update to a 7.x-1.x-dev version of a module, you can use the following command: drush pm-update MODULE_NAME-7.x-1.x-dev or, shorter: drush up MODULE_NAME-1.x-dev so you can omit 7.x-.


32

The method below will stop the "available update" emails Drupal admins receive. Go here: http://yourwebsite.com/admin/reports/updates/settings Remove your email(s) from the textarea: "E-mail addresses to notify when updates are available" Save Note: If you want to stop the "available updates" emails and the update alert messaging then simply disable the ...


29

field_delete_field($field_name) will mark the $field_name for deletion on next cron run. You could use field_purge_batch to do the deletion, if you don't want to do it on cron run. EDIT: field_delete_field() should be used when you need to delete the field from other bundles as well. If you only wish to delete the field from a particular bundle you should ...


26

As mentioned in the original question, and follow-up comments, there are a variety of contrib modules and manual methods to accomplish this. To do it automatically, or in a custom fashion, I think hook_update_N() is still probably the most viable option. For instance, this is an example from the Head 2 Head to update system.site to set the default_langcode:...


24

To remove a field from a particular bundle you can use field_delete_instance() Marks a field instance and its data for deletion. Example: function my_module_update_7001() { if ($instance = field_info_instance('node', 'field_name', 'page')) { field_delete_instance($instance, TRUE); field_purge_batch(1); } } To remove a field from the system ...


21

On Drush 5.7 you can run the command drush pm-update --no-core module-name. Drush will automatically backup the current module, download the new version and prompt you to update the database.


21

The project key from the .info file is added by the packaging script on drupal.org to identify what project the module is from. The primary use is for the Update status module to monitor versions of installed packages and notify administrators when new versions are available. You just remove or comment this line in .info file and Drupal stop checking for ...


21

In short, if your site runs on PHP 5.3, it will run on 5.5 as well, go upgrade! (Your dev environment, until a real release is out) With the short answer out of the way, here are some more details. With regard to "Does Drupal work on it", very little changed from PHP 5.3, to 5.4 to 5.5. The one issue that showed up under PHP 5.4 was really just PHP being ...


19

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 official releases, then the update code in the module should handle this. But in your case you are mentioning that your site is in developing. So there are a ...


18

The schema_version column in the system table contains the version of the last successful update. Manipulate that value and you can re-test your update. The name column is the machine name of the module, same as the info file is named. This query will do the trick for you. UPDATE system SET schema_version = XXXX WHERE name = 'name_of_module';


18

There are few ways of forcing module update. Calling the update function directly. $sandbox = []; module_load_include('install', 'FOO'); FOO_update_7001($sandbox); Resetting the schema version to the point of interest and run the updates again as usual. drupal_set_installed_schema_version('module_name', '7000'); Or reset to re-run only the latest update ...


18

drush rf will refresh the available releases and at that point you should be able to run drush up or drush up drupal.


18

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 deleting the related rows manually solved my problem: DELETE FROM key_value WHERE collection = 'update_fetch_task'; Solution 2: hook_update_N() If it is not ...


15

So just a copy paste from drupal.org. You also need to add the schema definition to hook_schema. /** * Create new database table {mytable2}. */ function mymodule_update_7101() { $schema['mytable2'] = array( // table definition array goes here ); db_create_table('mytable2', $schema['mytable2']); }


15

Drupal 7 If you're using drush, you may run: drush eval 'menu_rebuild();' If won't work, see: How to do menu rebuild when having PHP Fatal error? Drupal 6 drush php-eval 'drupal_rebuild_theme_registry()' memcached If you're using memcached, you've to restart it. On Linux: /etc/init.d/memcached restart On OS X (if using Homebrew): brew services ...


14

Just providing a code sample to help the chosen answer: function MYMODULE_update_projects_alter(&$projects){ unset($projects['slug_of_the_module_you_want_to_disable']); //dsm($projects); // view a list of projects } Enter the module name in the $projects[] variable to disable. If you're not sure what the slug is (will be lowercase and ...


14

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-dependencies If you started you project from "drupal-composer/drupal-project" the command becomes the following. composer update drupal/* webflo/drupal-core-...


13

I use: drush pm-updatecode --check-disabled followed by: drush @sites updatedb The --check-disabled option was added 2014-11-04


13

You can do it in two ways. drush pm-updatecode --lock=module_to_ignore Use the update_advanced module. It allows you to mark modules that you want to ignore on the module administration page. In particular, the per-project settings to ignore certain projects or even specific releases, is absent in the core version of the module. The "Update status ...


13

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/


13

"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 details from @kiamlaluno's answer to create a drush script which you can use to reset a single hook. Here's a basic version (longer version is here): #!/usr/bin/env ...


12

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 = 'module_name'; (As noted above, the actual value should be less than the hook_update_N() you want to repeat, but higher than or matching the last update that does ...


12

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 developing projects we constantly update our test / acceptance environment with new configuration updates. Take for example a simple fictional News-module, we'd like to ...


12

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 config import before updates An update hook relying on a configuration value could end in a different result than if it were run on the pre-import value. An update ...


11

Another reason why an update hook would not run is a mismatch between the update hook name and the major release number of the module (see .info file). For example: the update hook mymodule_update_7001 does not run if the module version is 7.x.1.0. In such case you must rename the hook to mymodule_update_7101. See the hook_update API documentation


11

Open the database schema, then delete all contents of menu_links and menu_router tables with the following SQL queries: DELETE FROM menu_links; DELETE FROM menu_router; Then run http://example.com/update.php. It will call menu_rebuild(), which will populate these tables with 'fresh' data. It worked for me after a "PHP Fatal Error: Out of memory" turned ...


11

I presume that you are using drupal-composer/drupal-project as the basis for your project. If not, take a look at that project, and compare it with yours. Also, you said that you want to use composer to manage Drupal 8 dependencies, so I presume that you have selected your contrib modules via composer require drupal/devel rather than drush dl devel. If ...


11

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 yoursite.com/update.php Follow the on-screen instructions Note: if you use composer then see my answer to this question


10

It might be issue with permissions of Drupal root directory.. Try running them as sudo sudo drush up Above command updates all enabled modules and core in Drupal... Try using sudo drush up drupal which updates only core.. It worked for me.. I Updated from 7.22 to latest 7.27.. Try with -v for more information.. sudo drush up drupal -v To ...


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