WordpressUpdate: verschil tussen versies

Uit MakerSpace Leiden
Ga naar: navigatie, zoeken
(Nieuwe pagina aangemaakt met 'Unfortunately - the default ubuntu install is a bit too broken to allow for an automated update. The manual update process for simple releases is as follows: 0) R...')
 
 
(7 tussenliggende versies door 3 gebruikers niet weergegeven)
Regel 1: Regel 1:
Unfortunately - the default ubuntu install is a bit too broken to allow for an automated update.
+
[[Categorie:Infrastructuur]]
 +
 
 +
Unfortunately - the default ubuntu install is a bit too broken to allow for an automated update in general.
 +
 
 +
== Small updates ==
 +
 
 +
Can be done through with a bit of care using a script that temporarily changes the file permissions:
 +
 
 +
# log in as admin.
 +
# navigate to the 'update' page. Do not press it yet.
 +
# run the script  /usr/local/bin/wpup with 'sudo' op de MSL server.
 +
# when the prompt appears -- press the update link in the browser
 +
# wait for the process to complete.
 +
# press return in the terminal to complete the process.
 +
 
 +
What this script does is fiddle a bit with permissions; temporarily allowing the neutered user apache runs as write access to the pages it serves (normally a very big `no-no'). And once complete - putting it back to something safer.
 +
 
 +
== Large updates ==
  
 
The manual update process for simple releases is as follows:
 
The manual update process for simple releases is as follows:
  
0) Read the rel notes https://codex.wordpress.org/Version_4.9.8 (substitute the right version number)
+
0) Read the rel notes https://codex.wordpress.org/Version_VERSION (substitute the right version number for VERSION)
 +
 
 +
1) Consider making a backup of the database:
  
1) Fetch a recent copy from https://wordpress.org/download/releases/
+
    umask 077
 +
    mysqldump  --single-transaction --quick --lock-tables=false wordpress > ~/wordpress-pre-VERSION.sql
  
2) Then checked, unpacked and renamed it:
+
2) Fetch a recent copy from https://wordpress.org/download/releases, check, unpacked and _rename_ it:
  
curl -O https://wordpress.org/wordpress-4.9.8.tar.gz
+
Warning - do not do this in /usr/share - as it unpacks in wordpress rather than something version number namespaced.
openssl sha1 wordpress-4.9.8.tar.gz
 
tar zxf wordpress-4.9.8.tar.gz
 
sudo mv wordpress /usr/share/wordpress-4.9.8
 
  
3) Get some sanity
+
    curl -O https://wordpress.org/wordpress-VERSION.tar.gz
 +
    openssl sha1 wordpress-VERSION.tar.gz
 +
    tar zxf wordpress-VERSION.tar.gz
 +
    sudo mv wordpress /usr/share/wordpress-VERSION
  
cd /usr/share
+
3) Get some permission sanity
  
sudo chgrp -R www-data wordpress-4.9.8
+
    cd /usr/share
sudo chmod -R o-rwx wordpress-4.9.8
+
    sudo chgrp -R www-data wordpressVERSION
 +
    sudo chmod -R o-rwx wordpress-VERSION
  
 
4) Take risk (after scanning the release notes) and copy the old config across
 
4) Take risk (after scanning the release notes) and copy the old config across
  
sudo cp wordpress-4.9.7/wp-config.php wordpress-4.9.8
+
    sudo cp wordpress-4.9.7/wp-config.php wordpress-4.9.8
 +
 
 +
And link it in
  
5) Test cursory and declared victory
+
    ln -s /usr/share/wordpress-VERSION /usr/share/wordpress
  
Dw.
+
5) Test cursory and declared victory. Then let the mailing list know and ask people to be on the alert for issues.

Huidige versie van 4 sep 2023 om 16:40


Unfortunately - the default ubuntu install is a bit too broken to allow for an automated update in general.

Small updates

Can be done through with a bit of care using a script that temporarily changes the file permissions:

  1. log in as admin.
  2. navigate to the 'update' page. Do not press it yet.
  3. run the script /usr/local/bin/wpup with 'sudo' op de MSL server.
  4. when the prompt appears -- press the update link in the browser
  5. wait for the process to complete.
  6. press return in the terminal to complete the process.

What this script does is fiddle a bit with permissions; temporarily allowing the neutered user apache runs as write access to the pages it serves (normally a very big `no-no'). And once complete - putting it back to something safer.

Large updates

The manual update process for simple releases is as follows:

0) Read the rel notes https://codex.wordpress.org/Version_VERSION (substitute the right version number for VERSION)

1) Consider making a backup of the database:

   umask 077
   mysqldump  --single-transaction --quick --lock-tables=false wordpress > ~/wordpress-pre-VERSION.sql

2) Fetch a recent copy from https://wordpress.org/download/releases, check, unpacked and _rename_ it:

Warning - do not do this in /usr/share - as it unpacks in wordpress rather than something version number namespaced.

   curl -O https://wordpress.org/wordpress-VERSION.tar.gz 
   openssl sha1 wordpress-VERSION.tar.gz 
   tar zxf wordpress-VERSION.tar.gz 
   sudo mv wordpress /usr/share/wordpress-VERSION

3) Get some permission sanity

   cd /usr/share
   sudo chgrp -R www-data wordpressVERSION
   sudo chmod -R o-rwx wordpress-VERSION

4) Take risk (after scanning the release notes) and copy the old config across

   sudo cp wordpress-4.9.7/wp-config.php wordpress-4.9.8

And link it in

   ln -s /usr/share/wordpress-VERSION /usr/share/wordpress

5) Test cursory and declared victory. Then let the mailing list know and ask people to be on the alert for issues.