Maintenance is about keeping your site healthy. The two main issues are backups, and updating your software. That's Drupal, and its modules.
There are other software updates, like operating system updates. Your web hoster will usually make those updates for you.
Backup
You want to get a copy of your server data onto another computer, or remote storage device. So if your server is hacked, or destroyed in an alien attack, you can restore your data.
What do you need to backup? Here's that mental model again.
You need to backup:
The database
The program files
Student data
Backing up the database
cPanel makes it easy to backup a database.
You'll get a compressed copy of your database, that you can store on your PC. I usually create a backup folder, and in that a folder for the current date, like 6-7-22.
Backing up the files
There are several ways to do this. The same cPanel backup program you used for the DB can backup files as well.
You can also backup the files manually, using cPanel's File Manager. Go to the folder with the files you want to backup, click Select all, and then Compress. Choose the compression type. I usually choose Zip, but you can make it whatever you want.
cPanel choose the name for the zip file, using one of the names in the files you're backing up.
When the backup program is done, you'll see the zip file in the File Manager.
You can rename the file if you want, with a name that better reflects the contents of the file.
You can download it to your PC.
Once you've downloaded the file, you can delete it from the server. Or not. You choose.
The backup wizard
cPanel has a wizard that will backup files and databases in one hit.
I've never tried it. If you have, let me know what you think.
Updating modules
Composer makes updating modules easy.
BTW, I recommend you backup your database and files before you do a module update. Just in case.
Start the terminal, and switch to the folder containing your course website.
Then check that you're in the right folder. Use ls or ll. There should be a file called composer.json.
OK, we're in the right place. Now to update the module. Let's update... Skilling.
composer update drupal/skilling --with-dependencies
Here's what I got. You can see the change in the version.
Updating Drupal core
You can also update Drupal core with Composer. Here's there's a core update available. I usually don't do core updates unless there's a security issue, but let's do this one anyway. BTW, I recommend you backup your database and files before you do a core update. Just in case.
Start the terminal, then switch into the folder where you installed Drupal. It has the file composer.json in it. Then run:
composer update drupal/core-recommended --with-dependencies
When I tried this just now, I got an error.
Hey, Adela. Any ideas?
Hmm... we messed with the default folder when we were configuring Drupal. Could it have to do with that?
Good thinking! Composer wants to delete default/default.settings.php, probably to replace it with a new one. Let's use the File Manager to check the permissions of that folder.
Nobody has write permission to the folder, not even the user (that's us, and we own the account!). We locked Drupal down so much, Composer can't do its job.
Oh no! I mean, yay for security, but oh no!
Let's give ourselves write permission to the folder.
Composer ran just fine. It updated Drupal core to the new version.
DB updates
Most updates only affect files. Occasionally, though, an update will change the database as well. If Drupal asks you whether you want to run DB updates, you do.
You might see this on the status report.
Click that link! Here's the page that runs DB updates.
Notice the URL, /update.php. If you see that, let it do it's thing.
Clearing the cache
Drupal is complex, with many thousands of lines of code. If all the code ran every time someone asked for a page, your site would be s-l-o-w.
So, when Drupal works out what a page or part of a page should look like, it stores that in a special place called the cache. When someone else asks for the same thing, Drupal doesn't recompute it. Instead, it grabs the thing from the cache. Much faster.
It works well... most of the time. However, detecting when a cached item needs to be refreshed is a difficult problem, and Drupal doesn't always get it right. If Strange Things are happening on your site, your first step should be to the clear the cache. We're talking about Drupal's cache here, not your browser's cache, but clearing that too is a good idea.
If you installed the admin toolbar module, there'll be this menu entry:
Don't try to work out which cache to clear. Clear them all.
You call also use Configuration | Development | Performance, and click the Clear all caches button. There's also Skilling | Configuration | Clear caches.
Section contents
Maintenance
You are here
Leave A Comment