× PHP Version Test Update PHP Help & FAQs Get PHP Version Notifications Find a PHP Developer
PHP expiry alert : PHP v7.2 has recently expired. Is your website still running this version? Click here for more details
SAFE versions of PHP: 8.0.11, 7.4.24, 7.3.31

How to backup your website before upgrading PHP

The process of backing up your website will depend on how and where it is hosted. The process can be summarised as being possible via one of two or three likely methods:

  1. The easy option: An interactive tool that does all the hard work for you. You will likely just need to click a few buttons to start a backup process that is accessible via a control panel interface that your web provider has given you access to.


    The exact process will vary depending on the web interface that you have been given by your ISP so specifics cannot be given here. However cPanel, Plesk and many other well-known web based control interfaces all contain backup options. Search your control panel for an icon titled 'backup' or 'full backup'.


  2. The fairly easy option: A more manual backup process in which you need to manually backup the files and database that your website consists of via tools provided in the control panel interface that your web provider has given you access to.


    The exact process would vary depending on the services and access you have to your web server. You may be able to undertake these tasks fairly painlessly. Firstly by going into a file manager type utility provided in the control panel interface provided by your ISP. From here you would create a zip file of your entire website root folder.

    You may also have access to an interface from where the website database/s are managed and this will likely have an option to create backups/exports.

    Once backed up you would then ideally copy the zip file and database export off the server to local computer's storage for safe keeping.


  3. The advanced (techy) option: A totally manual backup process undertaken by yourself from the command line interface.


    If you are running your website on a platform that uses droplets or kubernetes or is a manually installed VPS (virtual private server) with no web admin interface then the only option you will likely have for managing your server is via a CLI (command line interface).

    The exact process would vary depending on the web server type that your website is run on and for that reason, if you have such hosting you probably already know how to undertake this relatively simple administrative task.

    However as a rough guide, you could backup your public website root by running the following command from within the root of your web space:

    zip -r website-export.zip public_html

    And your database (assuming it's MySQL/Maria DB) could likely be extracted using a command such as:

    mysql -u UserName -pPassWord DatabaseName > export.sql




REMEMBER: If you are not comfortable following the above steps don't risk breaking your website! Call upon a web developer with experience in websites built in PHP.

Article last updated: 25th January, 2021