Deleting and Restoring an Application from Source Control
[Music] hey everyone it's Justin thank you for watching in this video I'm going to show you a problem I ran across with deleting an app that I imported from Source control re-importing it and then not being able to do anything with Source control so let's get right to it this might take me a minute to show you everything I'm going to go ahead and delete this application that I've been working on that was the flow when I did I want to make sure that I practice stuff before I demo them for videos so I did it and then I came in and I deleted my app so I could record it and show my build with AES or hashtag bill with AES video re-importing an application into app engine Studio from Source control here's the rub when you're deleting an app using Source control and this could be an app engine Studio or it could be in the old Studio it is going to error out and say that there's still files remaining and you need to delete those files before you delete the app again you'll see the message here in a second now the trick with that is you can't delete the app again there's the app doesn't show anywhere to be deleted again but there is actually some stuff still remaining that you need to look at so while this is deleting let me show you something that's going on and that is over here in my local update sets so when I have an application that I import from The Source control it creates a system administrator uh updates for that application so if I go and open this update set you're going to see like 60 some ish or no I've got 102s that means I probably finished already yeah finished so I've got 102 updates or customer updates and the first ones were importing everything and the second half of the updates are deleting everything right so it did all that so the app is deleted that's where I thought I was done and I went and did my video I went to this import app I put in my source control like you saw on the other videos so you should be familiar with that I get rid of this put in my email address like I'm going to blur this out and post um but it's just my email address and then there's my credential and I re-import the app so um okay so it's already there it's not going to let me do it it's already associated with this I showed this in my last video too so if you go to this location um this underscore repo underscore config dot list that's going to show that there's an app already there for Source control and notice that just like in my last video the application is empty it's kind of like a ghost record so yes you got to do this you got to delete this so we'll delete that hit delete and then this is the same path I took from my previous video I got that deleted I came back here hit the back button tried it again import app and it worked and everything was great right so everything should work everything should be fine the issue was once I did this and I completed the video I couldn't create a branch I couldn't pull from the repository I couldn't do I could even commit any of my code changes any changes that I was making and so I couldn't keep developing my app which was really frustrating so back over here to that local update set we'll just go ahead and pull that up again while that's importing uh it's importing and it's going to create its own update set so if you look here I still got this system administrator uh one but notice I've got the state is set to ignore so I've got again some Legacy leftover stuff that's showing in service now if I go back to that app it should be done let's say 85 should be done importing in a second I'm going to hit refresh here and see if we've got that other updates that I don't yet so let's just wait for this to complete there we go that actually didn't take long at all I'm going to close that out and I want to show you what happened to me so I'll open my app and I'll try to do anything right so let's go to Source control let's create a branch so I'm going to put in here demo branch and then if you look behind my head I've got this create a branch button I do that and Bam I get this red error message so I go back I tried it again I deleted the app I re-imported it deleted it re-imported like seven times and because created a gigantic mess for myself here's the fix come back over here update sets look what's going on I've got now two update sets there's the one that's ignored there's one that's in progress this ignore one is my old app that's no longer there so what you need to do is you need to go into the update set and delete all of the updates so get get rid of them so they don't show anymore I have this in here I think it was like 102 and I've got a road limit of 20 so I'm gonna have to do this a couple of times in order to get this to work so let's just go ahead and start deleting these um it's hanging up here a little bit and make sure I'm in the right scope I am in the right scope at the moment so let's try delete and I'll click the button harder let's do this let's refresh not everything goes well in the demo I'm going to refresh this whole form seem to be hung a little bit there we go okay so none of those got deleted so let's start deleting delete there we go there's my confirmation okay that's working like I should so I've got to do this a couple of times and uh and you can imagine me I had to do this like eight different times because I just kept reimporting thinking that was going to fix it and it doesn't you've got to get rid of these remnants of the application even though it says on the update set ignore you got to get rid of this stuff that's the only way I was able to fix this so we'll delete that and one more check here delete that and I think I'm close I should have two more left and I'll be able to delete this update set so I'll pay attention up here notice I've got no delete button until I finish this last delete uh we'll just do it here and hit delete right there hit okay and now I should there you go I got a delete button and I can get rid of this stupid update set that is causing me not to be able to create a branch or do anything with my application so I thought I was done came back over here went to Source control went to Creator Branch test branch and then again right behind my head create Branch got the same error message so I still wasn't done there's one more piece if you go back here to local update sets I'll call your attention to the default Global update set okay folks so there is a record in this update set of you deleting the application it's a custom application um there it is and it's behind my head it says delete is the action that was taken so this is still sitting out there and we need to get rid of it I can't get rid of it yet because I'm in the wrong scope so let's switch to Global scope here real quick from my app we'll go back to Global and clear that out let's let that change that might take a second here and what we're going to do is we're going to delete the record or delete that update now all this deleting I'm doing is on a table called sys underscore update underscore XML so that's the table where all this lives so you could save yourself some time go straight to that table but I'm going to get rid of this delete action on that app and so that way there is no record of that deleted app any longer in my PDI and so if I come back to app engine studio hit my backup button and then just create a branch again it doesn't work it doesn't work so we gotta try different name I already got that Branch so we'll do demo branch and hit createbranch and it should work so now it's going to go ahead and it's going to complete everything's going to work I can commit I can pull I can do everything I need to with this particular app so here's what I want you to remember if you import from Source control and delete an app that was from Source control you need to go delete the update sets that were related to the app that you deleted and you need to delete the record in the global update set of you deleting that application and then you'll be able to re-import the application 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 Source control and service now and until next time don't forget to always be learning [Music]
https://www.youtube.com/watch?v=Ig1AiXl4Y9g