Close

April 16, 2013

EC2 Swiss Army Knife

A client asked us how we could back-port a small database from MSSQL2012 database back to  a MSSQL 2008 database.  We know there is direct method of doing this, other than through an obscure process called “Generate Scripts”.  Essentially, it exports the database objects as SQL scripts, that are generic enough to be re-run on any version of MSSQL.  (For MYSQL folks, this is the default export format from a mysqldump).

In anycase, we did not have access to any MSSQL2012 servers, nor did we want to spend time installing the free Express version just for a single export.  To the cloud!  We spun up an Amazon Ec2 instance (ami-4e711627) that comes complete with Windows Server 2012 and SQL Server 2012 Express.  In our experience, you have to make the EC2 instance a type “medium” or “large” for it to be useful, but we still had a fully furnished server spun up in a few minutes.

We were able to quickly restore our 2012 database backup, generate our MSSQL2008 compatible database scripts, and terminate our instance all within a few minutes (and just for a few pennies).  We terminated our instance and we were completely done!  No need for any additional hardware, software, or combination of installation time.

The EC2 cloud instances could also be used for a whole variety of install tests of new software, without ever needing to purchase any hardware or software.  We just thought this was a nifty trick worth sharing.