This section details how to restore the SQL Server backup on a Windows AWS Server. This documentation assumes that you have to use Windows SQL Server to restore the backup but that is probably not true.
Create a Windows SQL Server
On AWS launch a new EC2 server.
For the AMI search “SQL Server” and select “Microsoft Windows Server 2019 with SQL Server 2019 Standard”.
For choosing an Instance Type I’ve tried a few. I found the queries to be very slow and couldn’t identify a blocking reason (I/O, CPU, Network, Queries, etc). So I can probably recommend any instance that has 16 GB of memory is really all you need.
I’ve tried ‘m5a.8xlarge’ and i3 storage-optimized. They don’t seem to increase performance.
If you are using a storage-optimized instance-type install AWS drivers so that windows can see the drive,
Then once you are in windows open disk management and format the additional drive and ensure you install the backup to the newly partitioned drive (probably D:)
To download to local disk: Copy-S3Object -BucketName your-s3-bucket-name -Key NLX/LMI-Oct2015.bak -LocalFile ‘C:Documents-Oct2015.bak’
Download and Install S3Browser
As a note: this is the preferred method. Additionally, it is recommeded that you buy premium ($30) to download faster
Open internet explorer
Go to internet options
Select security
Select internet
Select custom level
Scroll down and click enable file download
Download google chrome
Download and install S3Browser for faster downloads
Add IAM access and secret key to account to gain access to s3
Add the key to use the pro version
Select the options and mark concurrent downloads to 10~20
Download the NLX.bak file
Open s3 browser
Download the file from s3
The file will download in many parts
After the files are downloaded it will take awhile to merge the files locally into one nlx.bak file
Download Through the Web Browser
Open internet explorer
Go to internet options
Select security
Select internet
Select custom level
Scroll down and click enable file download
Download google chrome
Login to AWS S3 and download your file
Restore the NLx.bak File
Click windows and search for studio
Copy down the server name in the connect window for the python script later – if its blank click more
Start up SQL Server Management Studio, right-click on databases, ‘Restore Database’, pick file in device,
Screen will think for a minute once u select the file
Once u regain control select ok
Add Indexes
You will need to wait some time for the database to restore. Final step is to ADD INDEXES to the new database!
Click each table and add a non-cluster index for generatedJobId and/or applicationId when the table has it. This should speed your queries up big time. You may also want to add an index to the datetime fields as well.
Additional Instructions
The instructions below are included if you are planning to run a python script to process with the server. You may not have access to the provided python script at this time so these are left here for your reference.
Prepare for Running Python Script
Download Notepad++ (or other code editor)
Install python if it isn’t already (google python install)
In the requirements.txt file add ‘#egg=skills_util’ to the git url
Setup pipenv env with ‘pipenv –python 3.8’ (assuming thats the version you downloaded)
This step should generate a Pipfile from your requirements file. If it does not produce a pipfile with your items then do the following – install the requirements pipenv install -r requirements.txt