Home » Manually Update to WordPress 6.2.2

It’s time to update WordPress to version 6.2.2.

This minor release addresses 1 bug and 1 security issue. And because this is a security release, it is recommended to update WordPress sites immediately.

This is a manual update from the command line. Below are the recommended server setup for this update. 

  • PHP 7.4 or greater.
  • MySQL 5.7 or MariaDB version 10.3 or greater.

Server setup may change in the future, but most probably these steps to manually update WordPress will remain the same.

Step 1.

Backup all your files and database.

All files.

  • cp -p -R httpsdocs httpsdocs_backup

Database.

  • mysqldump -uNAME -p DATABASE > database.sql

Step 2.

Download the latest WordPress.

wget https://wordpress.org/latest.zip

Step 3.

Unzip the latest WordPress files.

unzip latest.zip

The latest WordPress files are now inside the new folder wordpress.

For reference, we now have the following.

  • httpsdocs – is the old version.
  • wordpress – is the new version.

Step 4.

Delete wp-content folder from the NEW VERSION. We don’t need the wp-content of the NEW VERSION because we will still use the old version wp-content folder.

rm -rf wordpress/wp-content/

After we have deleted the wp-content folder from the NEW VERSION, let us check to confirm that wp-content was removed from the NEW VERSION.

ls -lshtr wordpress/

Step 5.

Copy OLD VERSION wp-content folder to NEW VERSION.

cp -p -R httpsdocs/wp-content/ wordpress/

NEW VERSION should now have a copy of wp-content of the old version.

ls -lshtr wordpress/

Step 6.

Copy OLD VERSION PHP, TXT, and HTML files to the NEW VERSION. If you have other files in your root folder other than the wp-content, wp-admin, and wp-includes folders, copy them also to the NEW VERSION.

Since files from the OLD VERSION folder will be copied to the NEW VERSION folder, we can use the option -n to make sure we will keep the latest files.

Copy PHP Files.

  • cp -p -n httpsdocs/*.php wordpress/

Copy TXT Files.

  • cp -p -n httpsdocs/*.txt wordpress/

Copy HTML Files.

  • cp -p -n httpsdocs/*.html wordpress/

Step 7.

Everything is now ready. It’s time to switch to the new version.

Rename OLD VERSION to something else, and rename NEW VERSION to your root folder.

Rename OLD VERSION to httpsdocs_old.

mv httpsdocs httpsdocs_old

Rename NEW VERSION to the root folder httpsdocs.

mv wordpress httpsdocs

The manual update is finished. Go to your admin page to check.

Result.

Before.

After.

Notes:

  • The latest WordPress file link may change, better check Get WordPress page first before doing wget
  • Permissions may have been changed, you may need to chown and/or chmod your wp-content folder.

References:


Posted

in

by

Leave a Reply

Your email address will not be published. Required fields are marked *