SQL Server Tip of the Week – Domain Migration

I thought I would try a new feature, and hopefully get a schedule of tips I want to share with the world.

In the last week or so the subject of Domain Migration has come up for the millionth time in my career so far (slight exaggeration)

Switching domains is easy, log in on one domain, go to the system settings in Windows and change to the other domain, with a reboot committing the change fully. This is great, but what about the applications?

SQL is possibly the most popular DB platform out there, and up until the last couple of months has been restricted to the MS Windows platform. As a Microsoft product it ties in heavily to the operating system and Active Directory. Typically most DBAs will configure there SQL installation with dual authentication, Windows for binding Windows Accounts and SQL Authentication for local based security. The majority of applications these days will utilise Windows Authentication as this make the management of security policies such as password expiration and removal of users a little simpler, and generally management is from one place, i.e Active Directory. The only issue here is if you’re doing a manual Domain Migration (i.e no ADMT style tools) then as soon as you change the domain the SQL server sits on, the applications will no longer work and the users will not be able to connect. This is where the SA user is god, as it is local to the SQL installation not the domain/Windows element.

My advice for a manual SQL Server domain migration is simple:

  1. Ensure you have dual auth enabled
  2. Ensure you know your SA password (if not, create a new SA style user and note the password you use)
  3. Change SQL to use builtin service accounts (not a domain service account) before the move – can be changed afterwards to domain users under new domain.
  4. Change ownership of all DBs to SA
  5. Change ownership of all Task Agent jobs to SA

These should be done before switching domain!

For steps 4 and 5 I have the following scripts which I have used a few times now, and they do exactly as described, changing the ownership:

Change DBs ownership to sa:

EXEC sp_MSforeachdb 'EXEC [?]..sp_changedbowner ''sa'''

Change Job ownership to sa:

DECLARE @name_holder VARCHAR(1000)

DECLARE My_Cursor CURSOR

FOR

SELECT [name]  FROM msdb..sysjobs

OPEN My_Cursor

FETCH NEXT FROM My_Cursor INTO @name_holder

WHILE (@@FETCH_STATUS <> -1)

BEGIN

exec msdb..sp_update_job

        @job_name = @name_holder,

        @owner_login_name = 'sa'

FETCH NEXT FROM My_Cursor INTO @name_holder

END

CLOSE My_Cursor

DEALLOCATE My_Cursor

 

One additional step once the migration is done and the server is back up on the new domain, would be to login as sa, and add in the security groups/users from the new domain that need access to the server. I typically add the Domain Admins as SQL sysadmin users. To achieve this for the current domain you can run:

USE [master]
GO
declare @DomainName nvarchar(32)
set @DomainName = (SELECT DEFAULT_DOMAIN()[DomainName])
declare @DomainAdmin nvarchar(64)
set @DomainAdmin = @DomainName + '\Domain Admins'
print @DomainAdmin
EXEC master..sp_addsrvrolemember @loginame = N'NT AUTHORITY\SYSTEM', @rolename = N'sysadmin'
EXEC master..sp_addsrvrolemember @loginame = N'NT AUTHORITY\NETWORK SERVICE', @rolename = N'sysadmin'
EXEC master..sp_addsrvrolemember @loginame = @DomainAdmin, @rolename = N'sysadmin'
print @DomainAdmin + ' Has been Added as sysadmin'
GO

Incidentally this was one of my early attempts at writing SQL scripts without googling around! – not this also adds SYSTEM and NETWORK SERVICE (local builtin users) as sysadmins.

Epicor Users Group EMEA 2017 Conference

Epicor as a company would be nothing without its customers, and customers wouldn’t get very far without Epicor.
Throw into that mix an array of partners, after all I joined the Epicor world through a partner, and you have a fantastically balanced world of skills, expertise, knowledge, and ideas. More importantly it’s the people, and in the last week I finally got to really understand that community of people, and become a part of it.

On Wednesday, 15th November, 2017 at 08:30 I arrived at the Priest House Hotel, Castle Donnington, UK with an unusual, previously unknown kind of nervous excitement. I had arrived, suited and booted, laptop in tow and ready to showcase myself, represent my company and embrace this wonderful community.
Only 2 weeks prior had I received the invitation to present on Server and SQL Optimisation, a topic I know a fair amount about but the concept of presenting at this level was new to me. That said I think I may have mentioned previously that it was something that interested me, so it was potentially my own doing.
2 weeks to prepare a presentation isn’t a huge amount of time when you have a day job, and a home life to work around, but I relished the challenge and got stuck in, only a few days after the initial request and approval did I discover that I in fact had 2x 1 hour presentation slots…ah… a slightly bigger challenge, but again one to relish.
With 4 days to spare I had 2 presentations written, and a full mirror test complete, with only a slight worry on timings.
Fast forward back to 09:30 on the day and the first presentation begins, 30+ people in the room staring at me wondering how this will go down. 1 hour goes by, maybe a bit more, and it seems to be going ok. The questions are flooding in, I’m somehow managing to respond to all of them, answering everything thrown at me. The feedback continues into the break, a number of people saying “great presentation”, “thanks for the information”, “I’m going to look at X when I get back”. Wow, I actually resonated with some of these people. Bearing in mind that many have been in the Epicor and technology worlds far longer than I have, they seemed to all pick something up from the first one. Great, confidence restored, let’s nail the second presentation.
Before I knew it lunch was served, I was still conversing with various people; customers, partners, ex-colleagues and current ones. It wasn’t until I realised only a sausage roll was left in the room that I had gone through 2 hours of presenting and almost an full hour extra of chatting on only 1 coffee, a mini cinnamon swirl and this sausage roll!
Never before had I talked so much tech on so little caffeine, it was at that point I realised that knowledge, preparation and adrenaline we key to this day.

The EUG EMEA 2017 conference seemed to be a huge success across the 3 days from everything I have seen, the middle day on which I presented was focussed on non-product specific IT related topics. I think the fact I came up against the hot topic of GDPR in my session slots and still had a fairly full room was testament to the fact the nobody knows everything, and everyone wants to know a little more on the subjects of Server and SQL optimisation. The feedback at the time certainly reflects that.

I want to once again thank everyone in the EUG EMEA team for having me, the customers who attended the sessions for their perseverance, great questions and feedback and Epicor for letting me attend and present at fairly short notice. Hopefully this will be the start of a new chapter for me as I look to push on into 2018.

For more info on the Epicor Users Group (EUG) please check out the following:
Web: http://www.epicorusers.org
Twitter: https://twitter.com/eug_emea
Conference Twitter: #EUGEMEA2017

2017 Stats

In my last post I mentioned that I thought my install stats were somewhere in the 3-4 per month range, turns out I wasn’t too far off on that.

Last week I spent a little time updating my personal documentation and pulling together numbers etc. more so for my own confidence boost but also so I have some collateral to back myself up.

The stats read as follows:

please note I only started making my own notes outside of time entry/calendars in March 2017:

In 7 Months:

  • 24 Technical Engagements (categorised as over half a day solid consulting, not including “support” style assistance) – >3 per month
  • 22 different customers
  • 6 Go-lives supported (3 new/3 upgrades)
  • 8 international projects supported with training/documentation reviews etc.
  • 5/24 were on site engagements
  • 2 formal sysadmin training cources delivered
  • 4 cloud-based upgrades

So yes, I am in the 3-4 per month category and it’s nice to realise I am in the area I thought!

Level 3 and more

So, after I gained the Level 2 certification in my last post, I soon gained the Level 3 (after a battle on a couple of tough areas)

This now means I have a bunch of certificates showing I am trained in all technical areas of the Epicor ERP 10.1 product, however this does not mean I know the product inside out or can achieve any task asked of me. For that I need experience, and in whatever “spare” time available to me, I am constantly refreshing my knowledge, diving deeper into areas of the system and getting my head around the vast areas of business processes that can run through such a diverse and complex system.

On top of that we’re gearing up for a new release, and the 10.2 version looks set to be a game changer for many areas, and I will be sure to post links to the PR and marketing as I truly believe the new version looks the business! Watch this space…

Day to day I’m still installing and configuring ERP systems for many customers, I’ve lost track of the numbers a little bit, but probably installing 3-4 sites per month, many of these are upgrade projects from legacy versions and we now have fantastic tooling in place to make that journey less painful for the customer. It’s fair to say I’m very lucky having so many skilled and talented people around me, making my day job a lot easier!

Another area I’m very much moving into is training and on-site consultancy. If a customer needs a full system admin training course, or just a refresher then I’m part of a UK team that can now deliver that. To date I have delivered 2 full 2-day courses on sysadmin, and 5+ remote refresher sessions for those who already know the basics (or former versions) and need specific areas covering. System Admin courses include SQL management, ERP application server deployment, usage of Epicor admin tools, performance monitoring and many other areas.

Delivering these training courses is fast becoming one of my favourite things to do as typically I get to talk tech for 2 days with other technical people, enabling them to effectively manage the systems that run their business, regardless of what they actually make or do.

Career & Tech Update June 2017

Somehow I managed to let the last 7 months slip by without so much of an update, so no doubt anyone that usually reads this, no longer does!

However, I like to update this blog in order to note my milestones, especially where my career is concerned. I reference all aspects of the last post Found Here

So far in 2017 I have been pretty much doing what I did in the last 6 months of 2016, working with customers to develop technical solutions around their ERP systems. Primarily I am involved in the initial design and install of ERP environments, by that I mean I sit down with a customer (on a technical level) and discuss the various hardware and software requirements around the product the have already signed of on, mostly this is the Epicor ERP10 solution, which is a world leading product aimed at mostly manufacturing and distribution companies across all sectors. Once a customer has made an informed choice on their physical and/or virtual environment where their new system will sit, I am involved in planning, installing and documenting the base deployment of the system. Typically 4 databases (Live, Pilot, Test and Demo) with a variety of additional elements and solutions such as Web Access, Document Management, External System interfacing etc.

Traditionally that is the point where I stop and hand over to the customer a fully documented base install – note if this is an upgrade project they would have their data upgraded as part of this process too. However, I was set a challenge by my superior, and also by myself, tp go beyond the installations and technical planning stages, to spread my wings and my reach a little bit further, deeper into the product.

And so, after 6 months of mixing the day job as described above, with the other day job of keeping my old “managed services” customers up and running, and a few “tech days” on site at multiple customers; training their IT people on managing the ERP infrastructure with an addition of 9 solid days (spread out) of online classroom training, and additional self-paced learning courses… I am now certified as a  Level 1 Tools Consultant up to the latest released version of ERP10 (10.1.600). 

Whilst Level 1 does sound rather basic, and may even be ridiculed by some, what it has given me over the last couple of months, is an ability to understand and appreciate the inner workings of an ERP system, to finally understand how and why customers do not use these systems “out of the box”. Tools consulting is all about helping tailor a system to a company’s individual needs through the use of inbuilt tooling. I am also fortunate that I work alongside a number of people who go one step beyond this into the custom solutions world where they utilise external tools and code to further enhance the systems. I am no developer, but have always dabbled in code, and examples on this blog from years gone by show the random times when I have explored that side of my technical work. Being able to potentially start consulting on tools related work will definitely allow me to mix all aspects of my career to date, and this hopefully will be a great fit for me, allowing me to further enhance and adapt my career.

Back on my last post in November 2016 I listed a number of areas where I was developing within the IT/Tech world. I’d like to review some of those with an update:

  • SQL Skills – With the release of SQL 2016 and a number of challenges regarding compatibility with various platforms and products, I have yet again become rather adept at installation and configuration of SQL environments. I’m also starting to develop a nice library of useful SQL query snippets, from resetting DB ownership, to replacing strings in fields and backup/restore/overwrite of entire ERP environments!
  • ERP – As discussed above I now have a much deeper understanding of the implementation and usage of ERP systems, recent training has opened my eyes to the worlds of finance and manufacturing processes. I have also branched out further into some specific areas, such as CRM and Field Service setups. More of this to come I am sure.
  • Hyper-V – Not really had the chance to go really hands on with this level of setup, in most cases I advise the customer how to set things up but don’t actually get involved in those stages. That said I’ve fixed a handful of Hyper-V snapshot and backup related issues for multiple customers recently so I have to keep my knowledge up where possible.
  • VMWare ESX – same as for Hyper-V really, although I have some interesting migration/decommission work coming up soon so maybe a watch this space.
  • RDS  – I finally have my RDS customers stable and happy, with good performance and no recent complaints! I’ve also worked on implementations related to handheld warehouse devices and ERP client deployment both on RemoteApp and Desktop Sessions.

Do you remember the Coming up list…

Back in November I listed 3 key areas of focus for 2017, with a little Watch This Space…

It seems that out of the three items, two of them are very real, in fact the whole beginning of this post/story covers the Tools area, the other is Solutions, which as a side note to the day job appear to be my area of expertise. By this I mean i have become the main installation resource for a variety of extended solutions (CRM clients, Document Management Email plugins, Project Management integration etc.), also I have become a suport contact point for these and have had some significant contact around the globe  identifying and troubleshooting issues on these solutions. Basically becoming a human intermediary between Developers and Customers – as we all know Developer’s are beyond human  😉 

My last point was Cloud, and in a way without realising it Cloud is part of every day life at home and work. I need to specifically do more work with it, and have targets set against that, so I hope that by the end of this year I will be able to update in more details on that!.

 

Thanks as always for reading what is by far my longest post!