Restoring My PDI's MID Server
[Music] hey everyone it's Justin thank you for watching and welcome to my house in this video I'm back in my new PDI because I released my old PDI and I need to get my mid server back up and running my mid server is critical to my backup strategy and you can see here I have no mid servers on this new PDI so the first order of business and I I need to create a mids server account now remember I already have a mid server running in a container so I have a little bit less work to do than this video that you might have seen in previous videos where I stood up one from scratch so first step is going to be to create that user so I'm going to hop over to cisor user. list or I can just search for users and go to the user table um you can see very very light I don't have a lot going on so I'm going to create new here here I've got some documentation over here on my left on how I set up my mid server before so I'm just going to keep everything the same I think I called it pedantic Wing was the user ID and I will just call this actually let's just stay with the the theme there we'll call it pedantic wing and um am I going to be able to set a password I want to set a password set up the save record and collect set password all right we'll save I hope I don't have some nonsense around okay there's the set password button and let's see generate okay so I'm not going to be able to I'm going to copy this password all right so new new MID server password and that's okay it's going to be another new one and that's fine I'm going to show you how I deal with this on my container so there I got my password in there I'm going to uncheck password needs reset I'm going to save it again and then the last thing I want to do here is assign in a roll for Mid server so going to scroll down to rolls there and um it's just behind my head there is an edit button right there so I'm just going to click edit and we should be able to add the RO that I need for Mid server mid there it is mid server save okay and then that adds some other rules automatically so you can see the soap update script query create um in addition to the mid server R actually there's a lot more there there's eight new roles I got there from assigning the mid server Ro but that's all I need to do here I've got my name got my password so I'm going to go back to where we just were looking at my mid servers cuz we're going to check back in here after I get done all right next thing I'm going to do is bring up my container um now I'm going to warn you there's going to be a lot of blurring in here because it's going to have a password and it's going to have my instance URL um and I'm going to blur those out but I'll explain what I'm doing as I'm doing that so ring this over so you can see okay so what this is what you're looking at let me put it over here is this is a Windows box that I'm remoted into that has my Docker desktop running now yes I could be running Docker desktop on my Mac which is what I'm recording on but I'm of the kind of opinion person I'm the kind of person love the opinion to leave well enough alone if it ain't broke don't fix it and it's been working great my whole backup strategy it's been working great only sucks when I have to release my PDI and rebuild it all over again but you can see in this uh container in the environment variables it has my instance URL the mid password and the mid username which I'm going to have to modify when I kick off this um this image to run so we're going to open up a Windows subsystem for Linux here and I'm going to go ahead and um run that using some new variables for those environment variables in fact let me put this here so I can see the name of those so um and now I've got to reference my documentation on how I actually do this it's been a minute since I've done this so I'm going to go back here and drag this on I've got a third screen over on my right can never have enough screens and what I've got pulled up is my video where I set up the mid server for the first time so actually I'll show you what I'm looking at this is what I'm looking at and I stopped it on the screen where it's showing the command line to run my Docker container so that's why I'm actually referencing it and instead of doing this environment file I'm going to do something different okay here we go so I'm actually paid attention to let me do one other thing I'm going to do uh Docker image list yeah so I can see all my Docker images the one that's behind me right there this magical chaty is uh let's see I'm looking at this I'm looking at this right here the blue underline piece matches this one right here so the name of this server is mid with a tag of Tokyo 3 that's going to be important here in a second so I'm going to follow the command of Docker run and then I'm going to do d-v instead of I'm going to do mid in inst URL equals and then I'm going to type in the name of my new MID or my new PDI uh there it is behind me so https col Dev I'm just not going to say that out loud because I'm going to blow it out service-now.com and then I also need to set the password change as you saw when I was just setting it so mid midore instance password equals and then here I'm going to right click again edit and paste all right cool I got my password over and then that's all I should need now I just need the name of that image so I'm just going to put mid colon Tokyo 3 and cross my fingers and hope this works we'll see if we get an error message unexpected error unexpected token okay that's cuz the password is just a big bunch of mess and I didn't Escape anything um so there is a pen and a carrot and oh man what a mess okay so plan B here I'm going to have to spin up a new container which I haven't done in a bit I'm going to so this notepad is actually editing the file that I need to edit so that's good everything is there I just need to change the url so we're going to do this a little bit differently I'm kind of going on the Fly here and change the url in this text file now this text file is sitting in the recipe for the docker image so I had to do this before so that's probably why it pulled up the notepad++ when I pulled it up so updated the URL password's updated name's the same and the mid server name is going to stay the same so that's fine and so instead of doing the command line we did here I'm going to try a different one which actually is going to match my video pretty closely here so run- dv- file sln slash C slash users okay and then it's going to be in my one drive uh Slash Docker recipes and then it's mid- Linux and all that mess and then I'm going to do slash mid. EnV which is a file that I just edited in notepad++ you can see it there it ends in uh maybe you won't be able to see it uh mid EnV and then I'm going to put that same um so my video has a different image ID but I'm going to use the image ID I showed you earlier so I'm going to use this one right here uh I'm going to type that in there C c1276 DD 78 BD I'm actually hesitating cuz look this one has BD on the end but it doesn't have it on the end up here so I don't know what's going to happen here but we'll try it again and hit enter and hey something's happening I think it's I think what'll happen is it'll create a new container here oh there's four items let me scroll down okay now got a new one here called pedantic liman is now running okay so it's running Off to the Races it's doing its thing and actually the first thing it's doing is it's upgrading so you can see it's grabbing patch two hot fix one for Vancouver so that means it SU successfully connected to my instance so now we should be able to go back here and hit refresh and I said see a mid server yes I got my mid server it is upgrading so we're going to let it upgrade and the last thing whoops I didn't want bid Worden the last thing that I want to do after this gets done upgrading is I want to run it backup okay so again um the video I made last week was about hey if your PDI you need to be backing up so the first thing I'm doing actually the first thing I did is I got my service now Store updates application in there because I had an episode to record for last week and so I got that done it was a mess there's a lot of manual work and it's not fully up and running yet but I was able to get the episode out late late late late on Friday so now I want to make sure my backups are running so I can begin to fix everything and use my system as it's intended and part of using my system as it's intended is adding information updating files creating content records making sure I'm checking all the stuff I need to do to publish content and I don't want to do that in my PDI if backups aren't running because otherwise I'm doing doing work that's just going to disappear if something happens so backups are super super important and this mid server is a huge part of that okay I just saw it come back up and the CPU usage went down to like 1% so I think it's done let's check on service now see if the upgrade is complete it is up so we're going to open the mid server and we're going to validate it and we'll pull back up that window once I hit validate so we can watch that go so basically when it validates it um takes it up and down and we're going to go all that that allow all applications all capabilities all IP ranges great and we'll just move this off a little bit so we can monitor back here the validating and validated and when it's validated you can see now it's shutting down and restarting all right so this isn't going as planned I don't know why it has a name conflict um encountered an error ensuring agent on record on the instance retrying so I'm going to do something I'm going to kill that and we're gonna go to the mids server I'm going to stop it all right and we're going to start it again and if I wanted to watch the console I could just come in here and see the same thing like we seen before um so basically I'm getting out of that windows subsystem for Linux and going to watch it here directly in Docker desktop and man same thing what the heck an active mid server with duplicate name detected all right I'm just going to stop it again of course it's active it's supposed to be validating I'm just going to delete it delete all right and we will start it up again the nice thing about these containers is they're really really lightweight and you could do something like stopping it starting it real quick like that so we didn't get the name conflict this time so it seems to be a little bit happier let's um getting instance acl's all right that looks good it's in it's Q let's just hit refresh here all right so it's back up and running and this is like exactly where we started before uh it is sending okay so we're going to go ahead and validate again yes Save we should be able to watch it here shutting itself down and it should restart itself there it goes it started there just passing a key back and forth sure if you're motivated you could use that to hurt me sing packages getting instant successfully loaded reloaded and it's validated Okay cool so if you see over here what I was watching at the other side besides watching that go back and forth it did validate here so okay so we are good uh mid server is back up and running I'm back in business and um let's go ahead and go ahead and run an exports I'm going to go to uh scheduled exports actually should I just go to export definitions I can't remember which one to go to but let's do my ideas list oh no that's the wrong thing so let's go export export sets maybe and ideas should be an execute Now button is what I'm looking for um I'll know if where to export to what to export this the record is in the global application so let's switch why is the record in the global application anyways we'll deal with that later oh cuz ideas yeah ideas aren't part of my app um they're part of that and I there we go there's my export data I'm going export data and then we should be able to see that succeed or fail I might need to repick the mid server because of the CIS ID is probably changed now because uh that mid server that I exported the export definition with was in my previous PDI probably had a unique CIS ID and now since you just saw me recreate a mid server in this new PDI it's going to have its own unique CIS ID so I actually am just going to proactively kill this because I know it's probably not going to work um look at all those that are still exporting so that was the job kind of running itself and it hasn't been working but let's change this to export Target and we should be able to pick uh I need to go to that Target okay so open and yeah there there's exactly it that's the CIS ID of my old uh my old mid server so that's that's why it's a CIS ID it shouldn't be showing that and it should be this so that means I'm going to have to go through my export targets and update all those mid server um values but that's okay um so we'll update there and now I should be able to I'm going to can I cancel these let's just look uh let's go to the that's the youngest one right there wonder if I can cancel export set okay and then we'll just arrow down cancel cancel requested and I'm just going to cancel all these I probably don't need to do this but I don't know seems weird to leave it there and there we go so now I've got everything there cancel cancel cancel and now I'm going to let's just do a test export of 20 records there we go notice it came right up this time because it's not looking for that weird mid server with a CIS ID that doesn't exist it says it's successful so we'll go back to here we'll open up Windows subsystem for Linux and I want to get to my um this is me going into a bash command and that's pointing to my old container so I'm just going to change the container name notice I'm logging in as root it's okay lman l i l i h t e r n that should get me in and then I need to remember where this is I think it's here yepd snc mid server and then Ender agent and then there should be an export folder there it is there's my ideas so uh my ideas exported if I do VI ideas um yep I can see my ideas there perfect okay so m server back up and running exports are working what I'm going to do off camera is I'm going to go through all of my uh targets export uh targets and I probably I need to update that mid server value so notice how only ideas has the right bid server value and all the rest of them don't actually I guess I could do this while I'm here might not work if the application's not right so let me put the application column in here and see if anything's yeah I see how some of these aren't in global so I'm not going to be able to update those um but let's see what I can update uh with you here to show you how fast I should be able to update those records there we go same here Windows Docker mid1 there we go and we can update that one and I guess what I'll do offline is I'll I'll switch between the applications and go update my other ones but I want you to see how easy it is to get the you can see I'm backing up a lot of stuff um and that's because if you're a good Steward of your PDI and you don't want to lose anything um doing backups is kind of painless and if you set up a good system they run in the background let's see these empty ones and here's three more those there we go so I've got everything that's not in a scoped app and one more windows Docker M1 okay so just to prove um there you can see let me go back to the beginning here let's just grab another one um my where's my content table content tag content table so there a Content table oh I'm in targets export definition exports I need the export Set uh see export sets and content table which is what I'm looking at and we can preview that no I can't preview that because it says it's in Justin's house application which I haven't updated so let's go to one that I actually updated uh son of a biscuit export targets I updated um let's see export sets so let's go to export sets and see if that um export sets I should have one so I back up my export sets right and then you got to think about that um let's go ahead and export data we should see a run here went to the right mid server and we'll just come in here and we'll just do another LS there's my export set so that's it um now you just saw how it's not easy but it's not it's relatively painless if I already had a mid server running in a container I just needed to put in a new MID server password and username and URL for the instance and um some quick pivoting there to get everything up and running I hope you found this video helpful if you did please like Please Subscribe or share it with somebody who you think might be interested in setting up or resetting up their mid server in their PDI in service now and until next time don't forget to always be [Music] learning
https://www.youtube.com/watch?v=1Pc6D_36zAM