This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

CloudwaysCDN — a powerful solution that offers superior performance and satisfied global audience for your business. Read More

How to Backup a Drupal 8 Site

Updated on  1st May

2 Min Read
Reading Time: 2 minutes

Everyone knows the importance of taking regular backup of their website’s data. However, few website owners actually bother to learn how to backup 8 website correctly.

How to Backup Drupal 8 site Banner

If you own a Drupal website, it is absolutely crucial that you take regular backups. A consistent (and strictly enforced) backup schedule ensures that in the case of a disaster, your data remains protected at all times. The unfortunate fact about machines, in general, is that you never know when something might go wrong with them. Thus, data backups are often the only recovery option available to website owners.

In this article, I will cover the backup process for a Drupal 8 website. There are 2 ways of taking backup of Drupal 8  website:

  • GUI based backup
  • CLI based backup

GUI Based Backup

This is the easiest method of taking the backup of Drupal 8 website. The process has two steps:

  1. Backup your website folder
  2. Backup your database

Backup Your Website Folder

To backup your website folder, connect to your server using an FTP client of your choice (I prefer FileZilla). Once connected, copy the entire website folder to your local machine or to a cloud drive.

Backup Your Database

The next thing you need to do is to backup your database. The database contains all the data of the website and perhaps the most important component of your website. You can backup the database using PhpMyAdmin. Many hosting providers offers a native database manager that allows native database manipulation. Simply export the database to your local machine or your cloud drive.

That’s it. You have successfully backed up your Drupal 8 website using the GUI-based method.

Backup Using CLI

You can also backup your website using the command line for Drupal. This method is slightly more complex since it requires the use of the command shell. The steps in this process are basically similar. You create a local copy of the website’s folder and export the database.

Backup Website’s Folder

To copy the website files, use this command:

Backup Database

To backup the database, use this command:

Alternatively, you can use the following Drush command:

Conclusion

That’s it. You now know how to backup Drupal 8 site successfully. With this backup, you have a rollback point to revert to in case of a disaster. I recommend that you set up a regular schedule so that you have a very recent rollback point that you could restore your website in case of a disaster.

It is worth mentioning here that if you host your Drupal website on Cloudways, your website will be automatically backed up at regular intervals without you having to worry about the process, Cloudways also help in improving Drupal website performance see this blog post on: How To Improve Drupal’s Performance Through Cloudways.

If you have a confusion about the backup process, drop a comment below and I will get back to you.

 

Share your opinion in the comment section. COMMENT NOW

Hamza Zia

Hamza is a Drupal Community Manager at Cloudways - A Managed Drupal Hosting Platform. He loves to write about Drupal and related topics. During his free time, he can be seen obsessing over Football, Cars, Android and Gaming.

Start Growing with Cloudways Today.

Our Clients Love us because we never compromise on these

Get Our Newsletter
Be the first to get the latest updates and tutorials.

THERE’S MORE TO READ.