From c46dd82e0714150d114797f3abac0df92a508141 Mon Sep 17 00:00:00 2001 From: Amigo <49749100+aamigo@users.noreply.github.com> Date: Tue, 25 Jun 2019 15:55:35 +0200 Subject: [PATCH] Updated 039 Automated backup system in JCB (markdown) --- 039-Automated-backup-system-in-JCB.md | 64 ++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/039-Automated-backup-system-in-JCB.md b/039-Automated-backup-system-in-JCB.md index 05af39b..4f78d9e 100644 --- a/039-Automated-backup-system-in-JCB.md +++ b/039-Automated-backup-system-in-JCB.md @@ -1 +1,63 @@ -Hi I would like to demonstrate to you the new automated backup feature that's been added to JCB It is part of a [00:00:13](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m13s) Extension Which I called the API Which really gives you the option of Querying JCB Via a URL To perform certain functions First of which would be to actually generate a backup We not sure exactly What kind of features we should be adding to this API And we started to discussion [00:00:42](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m42s) About this on GitHub and You're welcome to Give me a shout Just send me an email you can Just check here My email address is Behind this link here Features we want to add to the API Currently the first one like I said is the backup feature Now [00:01:07](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m07s) JCB already Has in its Component area An export component feature which we basically just extended To automate But we've left it as well Here is a button called backup and it actually is the same feature except You can now manually also trigger that feature Now what this backup feature does Either being triggered by a [00:01:36](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m36s) A CronJob or being triggered by this button Is it actually Takes all your components And Exports them Encrypts stem Stores them on a local folder And emails the key to a Trusted email address Would you have set up [00:01:58](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m58s) Now The Components that are in your trash will not be Actually part of this backup So only components that are published Or unpublished or archived Will be in the backup every everything else will be ignored And Basically when the backup runs either manually or automated via A CronJob [00:02:26](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m26s) It will take those components Use the specific keys as it would with an exporting of a components An encrypted And Store them in that folder as I said Now There are some things you need to set up For all this to work As expected The first of these being in the options area of JCB there are some new [00:02:52](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m52s) Feature so let's just open that So we see there is now a mail configuration at DKIM And a CronJob Tab it added and also this field here called API user Maybe let me start with this field The API user Primarily be used for The ID that is used [00:03:20](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m20s) In the permission structure You see When you are in the components area And you trigger this feature manually It actually uses this current login user To determine whether that The components being you know encrypted and backed up Whether he has the permission to actually Do that Now [00:03:44](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m44s) This a way As we increase the permission structure of JCB You might end up having components that certain individuals who are in certain groups may not have access to them And then there might be components and Fields and views that they may have access to Or some that they may not have access to And so we're already now Laying some of the foundation to make sure that there isn't some loophole Where are there by Triggering a bash sorry a batch [00:04:17](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m17s) Update or export of components or backup They can't extrude certain components which they actually by Default don't have access to I know that's a long explanation but It's that's just to give you a background to why we still need an API user We still need a user Which now if it's automated the backup That this user ID actually Allows him to make the backup So that means that the IP sorry The API user should be a user [00:04:52](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m52s) Which has the permission To all the actual components Fields and Well everything actually In the JCB component Now It is secure because like I said the component Gets Compiled And stored locally We might [00:05:14](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m14s) Consider adding The option to push the component backup to an FTP Server But that part is not fully functional yet We we have had the The proposals made to do that so that the backup is actually not even on the same system But did it secure on another system so if this system Collapses You you still safe [00:05:41](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m41s) You still got you your data out So that sounds to me as a good Idea and so we will be adding an FTP Option as well Which will very much for the work similar as your components When you compile a component and it sends it off to a sale server or Or such That is really the same features will make use of anyway so That's just talking about Selecting an API user [00:06:13](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m13s) And why that is important Now When we go to the CronJob Tab We will see that there is some is basic instructions here For those of you familiar with CronJobs I suppose there everything is self explanatory Those who are not I would suggest you Google around Find some tutorials Read up Make sure you know what you're doing [00:06:40](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m40s) And that you're a very comfortable and setting up a CronJob There are various ways for you to trigger this URL The system currently detects whether your system actually can run curl request And if it can't it will fall back on the getoption Assuming that JCB is installed In an environment that allows these two functions to work If not you can simply take Only the URL And run it in a CronJob In in the manner that is [00:07:16](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m16s) You know applicable to your system And know that This URL actually just triggers The backup to start And when the backups finished It actually just tells you The same message that you will get If you run the backup by clicking backup here You see there is a green message that pops up Saying yes the backup was done the email was sent [00:07:42](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m42s) Those are the only messages That also actually Gets returned upon this URL So they they are the same Now We currently throwing that responds away But you could Add it to a log Depending on how regularly this CronJobs running There isn't the date currently I think [00:08:06](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m06s) It might make sense for us to add a date But at this stage there isn't one Ok so now we if you're running in a firewall your Joomla website has a firewall installed like RS firewall Then you you might need to adapt your Your curl request To behave like a real browser And here is a a a a post on stackoverflow that could actually help you Understand more about that So now currently the [00:08:39](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m39s) Cron backup folder path is set Here And so it currently only backups to a local folder As I said we will add an FTP option here We will still work out how we can do that and still have it secure Joomla doesn't by Default actually Encrypt fields in the You know Global configuration of your component And So that's might be part of what makes it difficult for us to implement This [00:09:11](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m11s) Here but But we will work on that The point is currently It stores it into a local folder And it Emails the backup key to the email address that you set in here Now make sure that email address is secure And that it is safe Obviously because the keys are being sent to it Now here is a naming structure for your file By Default it actually adds only up till the day so it will [00:09:45](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m45s) Make backups all through the day but overwrite the file every time Unless you add an hour then it'll only per hour overwrite it And if you add a minute It will actually never overwrite it because it will be a different minute every time So that is To rename your package and to see how much of the backups you want to Keep And If we go to the mail configuration area you see that it currently set to use the global Mail Configuration which is your Joomla default [00:10:23](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m23s) Now I would advise that you use a very secure method of sending the emails So either SMTP overwriting the SMTP settings here Or if you use the global ones then overwrite or insured at your Global Email settings in Joomla is also using SMTP That it actually runs through an SSL and is secure Ok the DKIM is also a added feature Which can increase [00:11:00](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m00s) Trust And security Off your emails Then there is the folder sorry the company Details Which At this stage Is important To add since it will also become part of the backup package And we will look at that again when we restore a backup to show you where this information comes up [00:11:28](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m28s) Ok so that some of the settings you need to first set Within your Global configuration Now once you've set those settings Company settings your CronJob settings Your local path the email the name And your User API user You can save and close this area And we can start looking at a component [00:11:54](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m54s) See this feature in action Now since this is a default Joomla website Sorry Joomla Install and JCB install There's only one component here And it's the demo component Now usually the demo component doesn't have Encryption key So I'll open it And [00:12:18](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m18s) I've already set it because I've done this video A few times So You basically come and set an export key In at least one of the components That will be part of the backup If any one of the components That are being backup have an export key It will actually encrypt all the components with that export key If multiple one's have an export key it will Combine those keys [00:12:47](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m47s) To use as the encryption key It hashes those keys so the actual key is not what is actually being used And the actual key that's being used is the one that will be emailed out To do that trusted email address So we'll save and close the the demo component And Then We will just run a manual backup here Which like I explained before is really similar to the CronJob except that it's triggered by clicking This button [00:13:18](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m18s) Ok so we just click it there And The moment since it's a very Just one component It's not a very big Process it should be finished quite quickly And it will basically say ok The backup has been Done successfully [00:13:36](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m36s) The owner details was set so if for some reason you forgot To set the owner details in the options area it will actually tell you that here And the email With the new key was sent So now To make sure that your backup actually works You should now go check the folder In which you set The Backup should be placed And see whether the backup is there And also [00:14:06](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m06s) Check the email address and see whether that they receive the key So I'll be doing that quickly Ok I see I have a backup actually here in the folder As expected So the backups been done I can double click into the backup And make sure that it has all the Expected files And at this stage it looks It Like It does if you have a lot of custom Files [00:14:38](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m38s) That you've added into the component There will also be an extra custom Folder in the zip Document And I not only in image one Ok so we will test this backup by actually importing it But first let's see if we received the email as well So here we can see that it also send the email as expected With the corresponding key Will be using this key to test the backup [00:15:08](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m08s) Be sure again like I said that it actually sends the key to a secure Website email address And that That That even the email that sense The Email from Joomla Is using a secure SSL by SMPT Now let's test this backup [00:15:35](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m35s) A backup will only makes sense if we actually lost our data so I'm gonna take the component And basically Wipe this one just delete it Throw that in trash Then go to trash and Empty the trash So know There is no components [00:16:10](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m10s) Click on import components Now we need to browse to the directory Where that component was backed up so we'll click on the directory tab So there we have the components The path to the actual backup package And we click on Get File Now we will take that key that was sent to us via the email And we will force the update And will add that key here [00:16:45](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m45s) And we'll click continue Sorry I just step back for a moment again Because I realized I didn't explain what you'd seeing here and like I said before your Package data of the owner of the package is displayed here And the package details are displayed here So if you have more than one component backed up all of those components will show Here on the components being imported And here You will see the The package owner [00:17:17](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m17s) Details And get the key from this link here So I will Again do this import I just wanna to quickly Get back to that Let's Let's click continue Wonderful so we have the component back It's all being restored And that's really what the purposes of the backup Is it when something goes wrong [00:17:40](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m40s) You can actually come back to where it was when the backup was made We can test with a backup has been successfully restored by going to the compiler And then selecting the component And clicking on compile And as you can see is been completely successfully built And we can now click on install the demo component And then we can even go To the demo component And see that Everything is actually working [00:18:18](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m18s) Adding a new look There's a all the various fields As it usually are Available in the demo component Well thank you for watching that is automated settings for JCB And setting them up and you making use of them +AUTOMATED BACKUP SYSTEM IN JCB + +### Extension API - Backup Feature + +Hi. I would like to demonstrate to you the new automated backup feature that's been added to JCB. It is part of a [00:00:13](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m13s) extension which I called the API. Which really gives you the option of querying JCB via a URL, to perform certain functions. First of which would be to generate a backup. We not sure exactly what kind of features we should be adding to this API. We started to discuss [00:00:42](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m42s) about this on GitHub. You're welcome to give me a shout. Just send me an email. Here is my email address behind this link. Just check features we want to add to the API. Currently the first one is the backup feature. + +### Button Called Backup + +Now [00:01:07](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m07s) JCB already has in its component area an export component feature, which we extended to automate. We've left it as a button called backup. It is the same feature except you can manually trigger that feature. Now what backup feature does, either being triggered by a [00:01:36](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m36s) CronJob or being triggered by backup button. It takes all your components and exports them, encrypts them, stores them on a local folder, and emails the key to a trusted email address which you have set up. [00:01:58](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m58s) The components that are in your trash will not be part of this backup. Only components that are published or unpublished or archived, will be in the backup, everything else will be ignored. Basically when the backup runs either manually or automated via a CronJob, [00:02:26](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m26s) it will take those components, use the specific keys as it would with an exporting of a components. Encrypt and store them in that folder as I said. + +### New Features - Mail Configuration, DKIM, Encryption Settings, CronJob Tabs Added + +There are some things you need to set up for all this to work as expected. The first of these being in the options area of JCB. There are some new [00:02:52](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m52s) features. Let's open that. We see a mail configuration, DKIM and a CronJob tab added and also this field called API user. + +### API User + +Let me start with this field. The API user primarily be used for the id that is used [00:03:20](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m20s) in the permission structure. When you are in the components area and you trigger this feature manually, it uses this current login user, to determine whether the components being encrypted and backed up, whether he has the permission to do that. [00:03:44](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m44s) It is a way as we increase the permission structure of JCB. You might end up having components, that certain individuals who are in certain groups, may not have access to them. There might be components and fields and views that they may have access to or some that may not have access to. We're laying some of the foundation to make sure that there isn't some loophole where either by triggering a batch [00:04:17](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m17s) update or an export of components or backup. They can't extrude certain components which they by default don't have access to. I know that's a long explanation, but it's to give you background why we still need an API user. We still need a user, which if it's automated the backup, that this user ID allows him to make the backup. So that means the API user should be a user [00:04:52](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m52s) which has the permission to all the components fields and everything in the JCB component. It is secure because like I said the component gets compiled and stored locally. We might [00:05:14](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m14s) consider adding the option to push the component back up to an FTP server, but that part is not fully functional yet. We have had the proposals made to do that, that the backup is not even on the same system, but that it is secure on another system, so if this system collapses you are still safe [00:05:41](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m41s) and still got your data out. That sounds to me as a good idea and we will be adding FTP option as well. Which will work similar as your components, when you compile a component and it sends it off to a sale server. That is the same features will make use of. That's just talking about selecting an API user, [00:06:13](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m13s) and why that is important. + +### CronJob Tab + +When we go to the CronJob tab, we will see that there is some basic instructions for those of you who are familiar with CronJobs. I suppose everything is self explanatory. Those who are not I would suggest you Google around, find some tutorials, read up, make sure what you're doing, [00:06:40](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m40s) and that you're comfortable by setting up a CronJob. There are various ways for you to trigger this URL. The system currently detects whether your system can run curl request. If it can't it will fall back on the weget option. Assuming that JCB is installed in an environment that allows these two functions to work. If not you can simply take the URL, and run it in a CronJob in a manner that is [00:07:16](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m16s) applicable to your system. And know that this URL triggers the backup to start. When the backup is finished, it tells you the same message that you will get if you run the backup by clicking backup here. You will see there is a green message that pops up, saying yes the backup was done, the email was sent. [00:07:42](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m42s) Those are the only messages that also gets returned upon this URL. We currently throwing that responds away. But you could add it to a log, depending on how regularly this CronJobs is running. There isn't the date currently. I think [00:08:06](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m06s) it might make sense for us to add a date. But at this stage there isn't one. If you're running in a firewall, your Joomla website has a firewall installed like RS firewall, then you might need to adapt your curl request to behave like a real browser. Here is a post on https://stackoverflow.com that could help you understand more about that. + +### Cronjob Backup Folder Path + +Currently the [00:08:39](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m39s) Cronjob Backup Folder path is set here. It currently backups to a local folder. As I said we will add an FTP option here. We will still work out how we can do that and still have it secure. Joomla doesn't by default encrypt fields in the Global Configuration of your component. That's might be part of what makes it difficult for us to implement this [00:09:11](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m11s) here. + +### Email (Backup Key) + +The point is currently it stores it into a local folder, and it Emails the backup key to the email address that you set in here. Now make sure that email address is secure and that it is safe because the keys are being sent to it. + +### Package Name Placeholders + +Now here is a naming structure for your file by default. It adds only up till the day, so it will [00:09:45](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m45s) make backups all through the day, but overwrite the file every time unless you add an hour, then it'll only per hour overwrite it. If you add a minute, it will never overwrite it, because it will be a different minute every time. That is to rename your package and to see how much of the backups you want to keep. + +### Mail Configuration Area + +If we go to the mail configuration area, you will see that it is currently set to use the Global Mail Configuration which is your Joomla default. [00:10:23](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m23s) Now I would advise that you use a very secure method of sending the emails. Either SMTP overwriting the SMTP settings. If you use the Global ones then overwrite or insured that your Global Email settings in Joomla is also using SMTP that runs through an SSL and is secure. + +### DKIM + +The DKIM is also a added feature which can increase [00:11:00](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m00s) trust and security of your emails. + +### Company Details + +Then there is the Company details, which at this stage is important to add, since it will also become part of the backup package. We will look at that again when we restore a backup to show you where this information comes up. [00:11:28](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m28s) That is some of the settings you need to first set within your Global Configuration. Now once you've set those settings, Company settings, your CronJob settings, your local path, the email, the name, and your API user, you can save and close this area and we can start looking at a component to [00:11:54](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m54s) see this feature in action. Now since this is a default JCB install, there's only one component. It's the demo component. + +### Set An Export Key + +Now usually the demo component doesn't have an encryption key. I'll open it, and [00:12:18](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m18s) I've set it. You come and set an export key in at least one of the components that will be part of the backup. If any one of the components that are being backup have an export key, it will encrypt all the components with that export key. If multiple one's have an export key, it will combine those keys [00:12:47](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m47s) to use as the encryption key. It hashes those keys so the actual key is not what is actually being used. The actual key that's being used is the one that will be emailed out to that trusted email address. We'll save and close the demo component. + +### Backup Manually + +We will just run a manual backup, which I explained before, is similar to the CronJob except that it's triggered by clicking the Backup button. [00:13:18](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m18s) It's one component, it's not a very big process, it should be finished quite quickly. It will say: The backup has been done successfully. [00:13:36](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m36s) The owner details was set. If for some reason you forgot to set the owner details in the options area, it will tell you that here. The email with the new key was sent. To make sure that your backup works, you should go check the folder in which you set the backup should be placed. See whether the backup is there, and also [00:14:06](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m06s) check the email address and see whether that they receive the key. I see I have a backup here in the folder as expected. The backups been done, I can double click into the backup, and make sure that it has all the expected files. At this stage it looks like it does. If you have a lot of custom files [00:14:38](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m38s) that you've added into the component, there will also be an extra custom folder in the Zip Document and not only in image one. We will test this backup by importing it. But first let's see if we received the email. We can see that it send the email as expected, with the corresponding key. We'll be using this key to test the backup. [00:15:08](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m08s) Be sure like I said that it sends the key to a secure Website Email Address, and that the email that sends the Email from Joomla is using a secure SSL by SMPT. + +### Testing Backup + +Now let's test this backup. [00:15:35](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m35s) A backup will only makes sense if we lost our data. I'm going to take the demo component, and throw that in trash. Then go to trash and empty the trash. There is no components. [00:16:10](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m10s) Click on import components. Now we need to browse to the Directory, where that component was backed up. We'll click on the Directory tab. There we have the components path to the backup package. We click on 'Get File'. Now we will take that key that was sent to us via the email, and we will force the update, and will add that key. [00:16:45](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m45s) We'll click continue. + +### Package Owner Details + +I just step back for a moment because I realized I didn't explain what you'd seeing here. Like I said before your Package Data of the owneris desplayed here, and the Package Details is being displayed here. If you have more than one component backed up, all of those components will show here on the 'Components Being Imported'. Here you will see the the Package Owner [00:17:17](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m17s) Details, and get the key from this link here(Testing Company). + +I will again do this import. Let's click continue. Wonderful so we have the component back. It's all being restored. That is what the purposes of the backup is, is when something goes wrong [00:17:40](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m40s) you can come back to where it was when the backup was made. We can test with a backup if it is been successfully restored by going to the compiler, and then selecting the component. Clicking on compile. As you can see is been completely successfully built. We can now click on install the demo component, and then we can go to the demo component, and see that everything is working. [00:18:18](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m18s) Adding a new look. There is all the various fields as it usually are available in the demo component. That is automated settings for JCB, and setting them up and you making use of them.