This video explores the “Advanced Backup” tab, and how to configuration a one-off backup with a configuration different from your saved profiles.
- Click "Advanced Backup"
The first option you have here is to load a profile. Currently, we can only select the "Default Settings", but we'll create a custom profile when we get to the "Profiles" tab.
Backup File Settings
Backup file name
So, if we scroll down just a bit, we'll see the backup file settings. The first option is the "Backup file name". You'll see that you can use tokens in the file name, this is because we have the Token module enabled. If you choose not to install the Token module, this will be empty.
We have two groups of tokens here. (If you're installing this on an existing site, you may have more options than what you see here. That is because other modules can add additional tokens, but on a fresh site, we just have "Current date" and "Site information" available) Don't worry about the "Current date" tokens, as we'll append a timestamp below. (If you choose not to install the Token module, you can still append a timestamp using the option below) In the "Site information" drop down, you'll see the [site:name] token that is used by default. This is the token I use most often, but another good option is [site:url-brief] ([site:url] will include http, which isn't really needed) I'll go ahead and use that just to show you what it will look like.
- Clear the "Backup file name"
- Click [site:url-brief]
You'll notice that you can simply click the token and it will be added to the field. You can also click additional tokens, and they will be added to the file name as well.
Append a timestamp
Next, we have the option to append a timestamp. The default is "Y-m-d\TH-i-s" If you'd like to know what these letters represent, take a look at the PHP date link that's included in the description. One thing to note is the "\" in the string. This is there so that the actual letter T will be included in the string to denote the time. Without the "\", the T would be converted to the time zone abbreviation as per of the PHP date format.
And next we have the compression options. You can choose "No Compression", "GZip", "BZip" or "Zip". If you don't have a specific reason to change this, I'd recommend you leave it at GZip.
Then we have a "File Encryption" section. Right now we can't do anything with this, but if you were it install the "AES Encryption" module, you’d be able to take advantage of that technology. It’s a little bit outside of the scope of this series, so we won’t be looking into this, but it is an option in case you’re interested.
Default Database Backup Options
Here you have some options about what tables are included and excluded from the backup, as well as the option to decide which tables should not have their content backed up.
Exclude the following tables altogether
This will exclude the table itself from the backup. This should almost never be adjusted. If you were, for example, to exclude the "users" table, not only would you not have any users when you restored from the backup, you wouldn't even have the table that contains user information. Thus, you'd be left without any way to log into your site, and you wouldn't be able to use that backup.
Exclude the data from the following tables
This option, on the other hand, can be quite useful! This will include the table itself, but exclude the data in the table. By default, all of the cache tables are excluded, since the cache is rebuilt on every cron run. When you restore a backup the cache is created right away. so, by excluding the cache tables, you can save quite a bit on the file size of each backup.
You will notice as I scroll down that the "cache_token" table is not excluded. This is a cache table that was created when I installed the Token module, so I can add that by holding down the "Command" key (if you're running Windows, you'll use the "Control" key) and clicking the "cache_token" table. If you forget to hold down the command key, and just click the table, you'll lose all of the other selections, and at that point, I'd recommend you just refresh the page, and reconfigure all of your changes. That way you don't miss some tables.
If there is a table selected that you'd like to include, but is currently excluded, you can use the same technique to deselect a single table at a time.
Lock tables during backup
This will lock your database tables while Backup and Migrate is running. This will help reduce possible data corruption, but means that no one will be able to create a new account, save or update content, etc. while the backup is running. I usually leave this unchecked, but you should decide what is best for your site.
Use mysqldump command
This will use the mysqldump command line tool if available. This makes backups run faster for large databases, but not all servers support the command. This is also experimental, so if you feel adventurous, and you know that you have mysqldump command line tool available, feel free to try this out on your server.
Send an email if backup succeeds
This option will send an email to the address listed below if the backup succeeds. This might get a little obnoxious if you're backing up on a regular basis (which you should be), so, I don't typically use this.
Send an email if backup fails
This option will send an email to the address listed below is the backup fails. This can be very helpful as it will notify you when you need to fix an issue with your backups. This is safe to enable, and we will enable it when we create a custom profile for our scheduled backups. Since I'm going to immediately download this backup, I'll know if it succeeds or fails, so I won't check this.
Take site offline
This will actually put the site into maintenance mode so that users are not able to access the site while the backup is being performed. This is similar to the "Lock tables during backup" option, but in this case the site will be inaccessible, while locking the tables allows users to browse the site but not save new content etc.
Site off-line message
This is the message that will be displayed to users if you choose to take the site off-line during your backup.
This is used when you store backups on the server, or other locations. It doesn't have any affect on backups that are downloaded. So, we'll talk about this in the !!!!!!!!!!video!!!!!!!!!!
Right now we can either choose download, or the manual backups directory. But we will create additional destinations when we get to the "Destinations" tab.
Save these settings
Checking this box will save these settings to the profile you have loaded at the top of the page. So, we could choose this and overwrite the default settings with the settings we have entered on this page. I'm not going to check it, to leave the default settings in tact.
Now, I'm going to click the "Backup now" button, to make a backup with these settings.
Once the backup is downloaded, you'll see that the new file name includes the URL instead of the site name. So that's how you can create one-off custom backups of your Drupal site.