In the age of computers and technology, the word ‘backup’ holds a very important value. There’s always a lingering risk of losing the data or compromising its security. To avoid such cases it is important to always have a backup ready in case anything goes awry. While Drupal is often touted as one of the most secure CMS out there, it too is susceptible to attacks.
In a previous post, I showed How To Backup A Drupal 8 Site. This time, I’ll show you how to avoid losing your data by maintaining backups. Here’s how you can make a backup of your Drupal 7 site easily using the Backup and Migrate Module.
Download and Install Backup and Migrate Module
Create a Database Backup
Now, make a backup of your site’s database using the Backup and Migrate module. Navigate to admin->configuration->Backup and Migrate. Before you do this, make sure that you set a private file directory on your local storage that is not accessible by the web in the File System settings of Drupal.
After doing so, you can start making a backup of your database.
Next, you will need to copy all the files including the .htaccess file in your Drupal site to the new location or server which will hold your copy of the site.
Delete and Replace settings.php
In this new site, delete settings.php in the sites/default directory. Now copy the settings.php from your old sites sites/default directory to the new one.
Install the New Drupal Site
Now, in your new location visit yoursitename.com/install and install Drupal as you normally would.
Enable Backup and Migrate
In your new site, go to admin/modules and enable the Backup and Migrate module. The module should be installed on the new site, since you had copied the entire filesystem of the original site to the new one.
Restore Database Using Backup and Migrate
Next, simply use the Backup and Migrate module to restore the database using the backup that you made earlier.
That’s it! You’ve successfully made a copy of your Drupal 7 site using the Backup and Migrate module. It’s important that you always maintain a backup of your database. Hope you found this guide useful. If you have any queries, please leave me a message in the comment section below and I’ll get back to you.