Site bijwerken (Drupal)

Uit De Vliegende Brigade
(Doorverwezen vanaf Drush up)
Naar navigatie springen Naar zoeken springen

Algemeen

Het commando drush up update een site: Core, modules & themes.

Meestal gebruik ik

drush up -y

om alles in één keer bij te werken. Soms geeft dat foutmeldingen. Die gaan vaak weg als ik

sudo drush up -y

geef, al verdient het vermoedelijk geen schoonheidsprijs om hier sudo te gebruiken.

Update voor een specifiek onderdeel:

drush up -y drupal
drush up -y views

Dat gebruik ik regelmatig, omdat ik alles wil updaten behalve het theme (daar gaat namelijk iets mis). Bv.:

drush up -y drupal, captcha, commerce_billy, search_api, search_api_db smtp, token, views, views_bulk_operations

Update Drupal core

Probably the default way to update Drupal core:

drush drupal

Example - 2023.12:

$ drush up drupal

Update information last refreshed: Mon, 12/18/2023 - 10:18
 Name    Installed Version  Proposed version  Message                   
 Drupal  7.87               7.99              SECURITY UPDATE available 


Code updates will be made to drupal core.
WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.
Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.

Do you really want to continue? (y/n): y
Project drupal was updated successfully. Installed version is now 7.99.
Backups were saved into the directory /home/jeroen/drush-backups/psy_nl/20231218092554/drupal.            [ok]
 System  7085  Remove FLoC-blocking variable.                                             
 System  7086  Prepare the schema and data of the sessions table for hashed session ids.
Do you wish to run all pending updates? (y/n): y
Performed update: system_update_7085                                                                       [ok]
Performed update: system_update_7086                                                                       [ok]
'all' cache was cleared.                                                                                   [success]
Finished performing updates.  

Drupal Core handmatig bijwerken

In maart 2019 kwam ik de situatie tegen, dat Drupal Core bijgewerkt moest worden (naar Drupal 7.65), en dat dat niet automatisch kon. Procedure (server-sided):

# Backup-map
###################
#
sudo mkdir /var/backups-dvb
sudo chown /ca

# Backup
###################
#
mkdir /var/www/backups-dvb/example.com-20190329
cp -r /var/www/example.com/* /var/www/backups-dvb/example.com-20190329

# Nieuwe Core
###################
#
cd ~/in1
rm -rf *
wget https://ftp.drupal.org/files/projects/drupal-7.65.tar.gz
tar -xzf drupal-7.65.tar.gz
cd drupal-7.65
cp * /var/www/example.com/

De nieuwe bestanden heb ik dus gewoon over de oude heengezet. Bestaande bestanden heb ik dus niet eerst verwijderd. Ik heb wel vantevoren een backupg gemaakt van de bestanden (maar niet van de db).

Zie ook