This page is written for LMS site administrators who are interested in learning about site backup and restore process, but who are not familiar with code, command lines or website administration. For others please see Site backup.
A complete LMS site backup involves 3 things: the LMS code, the lmsdata folder, and the MySQL tables. A course backup and download off site is always a best practice but it only involves parts of the lmsdata folder and SQL table.
- TIP: Please remember there are many different configurations for webservers and LMS sites. Most of the instructions below should start with the words “Generally speaking”.
Contents
2 Course Backups – better than nothing
3.1 Back up your lmsdata folder
3.2 Backup the lms code folder
5.2 Beginning administration FAQs
5.5 What else should you back up?
Before disaster strikes
“Do not gamble what you can not afford to lose“: think carefully about how often you will backup things and where.
When a major Website disaster happens, you may need to restore the three parts:
- lmsdata folder – sometimes called the: data files, LMS files, data directory, uploaddata, dataroot, or simply lmsdata (in lowercase). It is not called the “database”.
- MySQL or PostgreSQL database – We will refer to the MySQL database. There are other SQL database flavors which will work with LMS.
- LMS code – location of LMS code.
Thus it is a good idea to first know how to backup these parts so you can restore them to a new or existing webserver.
Course Backups – better than nothing
As the site administrator, you probably have set an automatic course backup in your site settings. Sometimes site administrators forget that these backups should be copied to a safe place other than their webserver. Instructors may be encouraged to download their course(s) backups to their computer on a weekly basis.
The course backups and restores only deal with parts of the lmsdata folder and MySQL tables. For example, they may include reference to a default theme or a contributed code module, but not the actual code or information that will make them work.
Backup up key folders
You will need a program and rights to go into your website files to make a backup. You can copy the folder to another off site location, or zip the folders and copy that zip file to another location.
An FTP (file transfer protocol) program might be useful. There are free programs such as CyberDuck and FileZilla. An FTP program copies a file from “there” (the server) to “here” (your desktop). Usually, this is as simple as a drag and drop and then waiting for the files to transfer.
Some webhosts will have an interface that will allow you to create a zip or tar file and download it from the server to your desktop, similar to an FTP program.
Back up your lmsdata folder
Use your program to copy (that is, drag and drop) the directory called “lmsdata” or the zip or tar file you created that contains this folder. This folder was named and created in the install process. It usually located in a public directory, not in the same directory as the lms code folder.
Backup the lms code folder
Use your program to copy (that is, drag and drop) the directory that contains the lms code. This directory is usually called “lms” and maybe in the public root (htdocs). You may have created a tar or zip file of this directory and it contents.
- Tip: Some sites only use the standard install package. And some of the site administrators of these sites like to use a clean install of their LMS code, instead of using a backup as described above. A potential problem with this practice may involve sites that have added modules or tweaked the standard LMS because these things will not be in a standard install.
Backup the MySQL database
Backing up the MySQL database is a different process and uses a different type of program.
MySQL can be thought of as a series of databases. Each database is made up of tables that share a common prefix in their name. Each table has records. The LMS intaller creates the LMS tables prefix. A typical prefix is “mdl_”. The goal is to backup these tables.
Open phpMyAdmin
phpMyAdmin can be installed as part of the LMS interface. When installed it can be found in the site administration block>Server>database. Many webhosts will use a program called cPanel, or have a link to a program that can manage the MySQL database such as phpMyAdmin. We will use phpMyAdmin.
Open phpMyAdmin. In the left pane, you will see your database(s) listed. Normally, the name of a LMS database will be something like mdl_ or have the description LMS. Click on the database you want to back up.
The page will refresh. In the left column, you should see all (around 200) the tables with the prefix of mdl_ (or what ever they were named when the LMS site was installed). Along the top you will now see a row of buttons. Click on the button Export.
You will see boxes with options in them (see below).
Enlarge to see an example of phpMyAdmin screen shot
- Check “Select all. ” In the Structure box
- Click “Add DROP TABLE, etc.”
- When in doubt, leave a setting at it’s default
- Go down to the bottom and find “Save as file”
it is a good idea to today’s date to the default name.
- Select the compression method (here we selected gzipped)
- Press Go in the lower right corner
A popup window will ask you whether you want to save the exported file. Click OK (Save). Wait for the process to finish.
phpMyAdmin will zip a copy of your database and send it to your home computer’s desktop.
Tips and tricks
Useful and free books
Every LMSr should download the free book Using LMS 2nd edition.
It tells you all about how to create LMS courses. Its final chapter (16) describes basic system administration, including how to automate the backing up of your courses. That automated course backup is really simple and you should do it.
The rest of Using LMS’s final chapter explains the administration settings on LMS’s front page. All those explanations are vital. However, Using LMS does not tell you how to backup your whole site.
Beginning administration FAQs
It is a good idea to reread the two LMS FAQs: Beginning_Administration_FAQ
and Beginning_Administration_2_FAQ
cPanel
cPanel is a common web host interface, where you manage what you have on your hosted server space.
You probably used cPanel when you installed LMS. It includes File Manager. In addition, cPanel includes phpMyAdmin that we discussed above.
Another Site Backup
It is a good practice for a site administrator to have a test site not on their production server. If you have a spare computer capable of Internet connection, you can create a backup/test LMS site. This is a great way to develop your abilities and test the process without using your production site.
- TIP: Create two different web servers as localhosts with the complete install packages. Turn on one and set it up as your production server. Turn it off and turn on the other web server as performing the restore process on it. Hopefully, you will not need to do this on your real production server, but you can practice.
What else should you back up?
There are a few web server files that might be handy to have.
LMS software is supported by three other types of software packages: a web server (Apache), the PHP code processor and a database(MySQL) server. These will be installed on the web server. A web host will generally maintain and updates these and other packages. These programs work with LMS code and communicate with each other.
It’s good to read the Site Backup FAQ You will not understand everything, but that’s OK.
Experienced system administrators back up their sites according to instructions here:[1] But that page assumes that readers can write Unix/Linux commands and php code. We have given you a simpler alternative above.
Backing Up before an upgrade or adding a new module
Backing up prior to upgrading LMS, needs special attention to details. Remember, when you upgrade LMS, it will change the LMS code, and probably the MySQL tables and perhaps things in the lmsdata folder. This is also true if you are tweaking the code or adding contributed code. The old parts may not be compatible with the new.
If for some reason the install does not work, you will probably want to roll things back by restoring the backups you made of MySQL, the LMS code and lmsdata.
See also
- Site backup General process for backing up a site
- Tools for backing up server files for experienced administrators