 So, I'm here from Lawrence Systems and we're going to talk about using IOCage and how to move a jail from one free NAS to another, or just how to back up your jail. The process can be used either way. If you want to learn more about me and my company, head over to LawrenceSystems.com. If you like to hire a short project, there's a Hire Us button up at the top. If you want to support this channel in other ways, there's some affiliate links down below to get you deals and discounts on products and services as we talk about on this channel. Free NAS, this is the 11.3 U2, both of these servers. There are two separate servers we have running here and I have some demos I've been setting up. And one of the things I wanted to do in those demos was use Pharaonix to do some benchmarking. And I built a manual jail for that, pretty easy to build a manual jail, pretty easy to load Pharaonix. But on a process, I want to repeat every time I rebuild a pool. So how do you take a jail running on one system? We'll go over here and there's our Pharaonix jail, which is currently in the status of down. It does have to be down for this to work. And how do you export this jail easily to another system? Now it was a little bit more complicated in the older versions of Free NAS that used Warden, but now that everything's in IO cage, it's actually really, really easy to do. So what we have here is a Free NAS system. This one right here is at 209. This one with the jail on it is at 212. If we go over to Jails, there's not even a place to put the jail set up. So actually I do have a pool, so I have a place to put them. I just haven't configured that yet, so we'll hit choose. And now we have a place to put the jails. So pretty straightforward. You do have to do that first to make sure that you, even if you haven't created a jail, that you've created that. So when you go to the pool and once you say it, it just creates this folder structure and a couple data sets. So there's places for all of this data to land. If you don't do that part first, you will have a harder time getting it because you need to specify where the jails live. So as long as you've got a pool, even if it has existing data on it, that's fine. And if it has an existing jails on it, that's fine too. We're going to import, well export one jail from over here and import it over to here. But pretty straightforward. So jails down and we got to take the name. We go from here and we're going to go an SSH into each of them. So this is the one that's labeled I7. This is the one that's labeled r730xd, I just named it based on the type of system. This one's kind of a hodge podge together I7. This is when we just created the location to drop the files on it, but it doesn't have any jails. And this is the one with the jail on it. So we're going to go here and we're going to go iocage export and capitalization matters. So it's Pharaonex. Pretty simple. We run the export. Now by default, it's going to export the data set to the Ocean Door SAS where it's located. Jails, Pharaonex, it's confirming this is the data set it's going to do. Preparing compressed file and it's going to drop it under mount Ocean Door SAS, iocage images, Pharaonex underscore, and it automatically adds a date. So this takes a couple of minutes when it does the export verification. It's going to create a checksum file as well. Doesn't take long to do, depending on the speed of your hardware. It might take long if it's a big jail. Might not go. It might take very short amount of time if it's a smaller jail. So this has got a handful of files in it because I was running Pharaonex a couple of times. So there's probably some leftover files. This takes probably about on this system about 30 seconds. So we'll just skip ahead to it being completed. All right. That's completed. Now what we need to do, over to this system here in cdcash, we have this one's called Orion, iocage, and we have the images folder right here. So what we need to do is get the file from here to there. Now you can download this locally to your computer. So you have a backup of it, but we're just going to copy it direct from one free NAS to another. So we're going to, and this is the name. So we'll just copy and paste it to make my life easier. Copy. So scp, there's the file, 192.168.3.209 colon slash. Then this is the folder we wanted to go and do over here. And away we go. So do this. It's going to prompt me for the password. And transfer is reasonably fast. So it's copying the file over there. All right. And if we do an LS, we can see the file arrive. Now we don't have to be in that folder to make this work. But all we have to do now is go to iocage, import. And we want to make sure we get the file, but we don't need the zip. So it's fronex underscore 2020-04-23 without the dash zip on it. We don't have to point it at the directory. It knows to look in the images directory. That's the default place. Importing data set, imported fronex data set. So we go back over here to our free NAS. This is the one that didn't have anything in the jails. Then we go back over, and there it is. And let's go ahead and fire it up and make sure it works. Start. And it's up and running. So jail is up. And let's refresh the page real quick here. I see the IP address I got, so I guess I can log into it. We'll just exit out of here. And someone will ask, guess this is just Tmux that I'm splitting the screen with. And we're up and running, and fronex is ready to go. The jail's ready. It's been imported to the other machine over there. There's the test suite. And there's instructions if you are wanting to run the fronex benchmark and put it in a jail. It wasn't too hard to do. It tells you what dependencies it needs and package install and the way it goes or set it up. But that's all you have to do to import or export the jail from one system and import it on another, provided it's running a modern version of free NAS. Now, this is not going to work for just moving a jail from the old previous versions, because I know this comes up a lot for people that are still hanging onto the old versions of free NAS because they don't want to have to do any jail recreation. This is not a cross jail creation. This is for modern free NAS instances that are running IO cage, but they've made it really simple to do. It creates that file. And of course, like I said, this is just a zip file. And you could just download it to your computer locally after this. And then you'd have your own copy of it for backups or however you want to do it. Also, yes, this can be scripted. And you can get more advanced where you take these and maybe export them to a different data set that maybe replicates somewhere else or backs it up off-site. However you want to configure it, but it's pretty easy to take these jails. And this is, you know, snapshotting them is great, but if you want to actually create that portable file, it just creates a really simple zip file of its inner. But be warned, and if you have a lot in that jail, of course, that file is going to get quite a bit bigger. Ideally, you're mapping data into jails. You're mapping data sets into jails, not actually storing all the data within the jail. So it should be just the operating system components. But you know, some of them, if you've got something custom you spend some time on, this is a pretty good use case to easily back them up. And in my case, because we're going to be testing a series of different free NAS scenarios with rebuilding the pools, I can just keep re-importing after I destroy a pool and all the data. I just copy this file, run the import again, and rerun my test with Veronica so I can get the benchmarks easier. All right, and thanks. And thank you for making it to the end of the video. If you liked this video, please give it a thumbs up. If you'd like to see more content from the channel, hit the subscribe button and hit the bell icon. If you like YouTube to notify you when new videos come out. If you'd like to hire us, head over to laurancesystems.com, fill out our contact page, and let us know what we can help you with and what projects you'd like us to work together on. If you wanna carry on the discussion, head over to forums.laurancesystems.com where we can carry on the discussion about this video, other videos, or other tech topics in general, even suggestions for new videos, they're accepted right there on our forums, which are free. Also, if you'd like to help the channel in other ways, head over to our affiliate page. We have a lot of great tech offers for you. And once again, thanks for watching and see you next time.