Importing a BACPAC to SQL Server

We previously looked at Create a backup for Azure SQL Server and in today’s post we are going to address how to look at that data by restoring or importing it to a local SQL Server.

To start, open SQL Server Management Studio (SSMS) and connect to a local instance of SQL Server. Right-click on the instance name and select Import Data-tier Application.


Simply click Next to go back the welcome screen of the import wizard.


Click browse and locate the BACPAC file on your local computer. Click Next.


Alternately, change the radio button to Import from Windows Azure and click Connect. You will be prompted to enter your storage account name and access key and then locate the BACPAC in your storage account. This will be downloaded as part of the import process to a temporary directory that can also be specified in the wizard.

On the database settings page of the wizard the database name, data file storage path and log file storage paths can be modified. The default locations for the data and log files will be pulled from the model database. Click Next.


Click Finish on the Summary page to being the import.


Each step and the status of the operation will be displayed. Assuming all green check marks click Close on the wizard. If there are any errors click the link in the Result column to see the details behind the failure. There should also be a new database in the SQL Server object explorer carrying the same name specified on the Database Settings page of the import wizard.


This satisfies the full set of requirements given by the customer:

  • Full backup of the data, archived monthly for 10 years – this can be stored in Azure blob storage and/or downloaded and stored locally
  • Ability to restore the archive at any time – a BACPAC can be imported to Azure SQL Database or to a local SQL Server
  • Maintain data access should the customer decide to no longer leverage Azure SQL Database – BACPAC files can be imported to a local SQL Server instance

Create a backup for Azure SQL Database

Azure SQL Database is a managed database platform as a service (Paas) offering available from Microsoft in the Azure cloud. One of the advantages to Azure SQL Database is all the file management, server maintenance and backups are taken care of automatically. Point in time recovery is built directly into the service. The amount of time a user can go back and perform a point in time restore depends on the service tier selected.

Creating the BACPAC

To start, open a web browser and access the Azure portal ( After signing in navigate to the SQL Databases section and select the database you want to archive.


On the overview page click the Export button near the top of the page.


On the resulting page name the BACPAC. Select the subscription and storage location where the BACPAC file will be saved. Enter the credentials that will be used to access the Azure SQL Server. Click OK at the bottom of the pane and the export process will begin in the background.


If you don’t already have a storage, you can configure one. Go to All resources, Add a new resource and search for Storage account - blob, file, table, queue. Be careful: the name of the storage is lower case.


Then in your new storage you have to create a container. You can create a container also in the Export process.

Under Activity log you can see the status of the export.


When the process is finished, in your storage you have to file under Blobs, ready to download it.

This file is a zip file and contains the structure and data of your database. Now you can delete the storage on Azure (it costs money).

How to reset lost SA password in SQL Express


If you ever find yourself in a situation where you need to reset the sa password on a SQL Express instance then you are not alone. I recently inherited a PC from a previous developer that already had SQL Express installed. This normally wouldn’t be a bad thing, except in this case it was not setup in mixed mode and my logged in account had no sysadmin rights on the instance.

In this article I hope to enlighten you as to how to reset the sa password in SQL Express without having any sort of administrator rights to the SQL instance.

You will need to be somewhat comfortable with editing the registry, starting and stopping windows services and working with a command prompt.

Steps to SQL Express sysadmin access

In order to gain sysadmin access to the SQL instance there were a few things that I needed to accomplish. Here is the basic goals I needed to achieve:

  • Change the login method from Windows Authentication to Mixed mode
  • Enable the sa user account
  • Reset the password to the sa user account

Doesn’t seem like that daunting of a list does it? I didn’t think so either.

Change the login method

In order to change the login method I had to change a registry setting. Why, you ask? Because, I say, we don’t have sysadmin rights so we can’t just change the database properties using SSMS.

  • Open the registry editor
  • Navigate to…
             \Microsoft SQL Server
  • Change the value of LoginMode from 1 to 2
  • Close the registry editor

One thing to note is I had a few different options under the “Microsoft SQL Server” branch so you may need to take an educated guess if yours is different.

Enable the sa user account and reset its password

I lumped these two into one section because the commands for them are entered at the same place.

  1. Open the Services applet in the Control Panel
  2. Find the “SQL Server (SQLEXPRESS)” entry and open its properties
  3. Stop the service
  4. Enter “-m” into the “Start parameters” field
  5. Start the service
  6. Open a Command Prompt
  7. Enter the command:

    Be sure to change PC_NAME to whatever your PC name is or you will get a big long message saying you messed up.

  8. At the next prompts enter the following commands:
    1> alter login sa enable
    2> go
    1> sp_password NULL,'new_password','sa'
    2> go
    1> quit
  9. Stop the “SQL Server (SQLEXPRESS)” service
  10. Remove the “-m” from the Start parameters field
  11. Start the service

At this point you should be able to login to SSMS using the sa user account and the new password you gave it.

Piwik C# Tracking API

This is an extension of the unofficial C# implementation of the Piwik Tracking API. You find my code on GitHub.


Three Visual Studio Solutions are provided : 

How to contribute

The Piwik C# Tracking API is a translation of the official PHP Tracking API in C#.

Translating the project is currently a manual process.

Manually translating the project is tedious because it requires

  • identifying features that have already been translated
  • merging code

We would ideally like to automate this process, we welcome contributions aimed towards this goal.

To ease the process in the mean time, the following rules are applied to any new code contributions :

  • a commit in the PHP project implies a commit in the C# project with the same message and content
  • one-to-one tag mapping between the PHP and C# projects
  • the C# code should mirror as close as possible the PHP code

As long as we do not have an automated process, we welcome suggestions in improving the manual process.

Code style

To mirror as close as possible the PHP code, we copy-paste the PHP code in the C# class and alter it so it compiles.

This can lead in a loss of C# best practices. We consider the time savings an acceptable trade-off.

Publishing the project to NuGet


  1. The process detailed in this section must be executed right before adding a release tag to git.
  2. Publishing the project to NuGet must be done by a member of the Piwik team, holder of the private NuGet Key.

Happy new 2016!

Amazon, Kindle e Liquavista: novità importanti, ma non per forza a colori

Amazon, Liquavista e un inedito ebook reader a colori, è una di quelle storie che di tanto in tanto vengono fuori in cerca di conferme. Sappiamo che Liquavista fa parte dell'azienda di Jeff Bezos dalla primavera 2013, da quando Samsung ne ha ceduto la proprietà dopo aver cercato di capire come sfruttare quella particolare tecnologia su tablet ed ebook reader. Da allora non è più successo nulla.

Ora Amazon pubblica il video "Meet the Liquavista Team" nel suo canale Youtube, e sostituisce il vecchio logo di con uno nuovo e moderno. E il tutto avviene a ridosso del periodo autunnale, del fine estate, storicamente il momento buono per la presentazione dei nuovi Kindle. Può essere un caso? Forse, ma tutta l'operazione ricorda le attività che si fanno per dare vita ad un marchio, per introdurlo e per crearci una storia. D'altro canto, perché Amazon avrebbe dovuto presentare ufficialmente l'acquisizione di Liquavista solo adesso, solo 2 anni dopo?

Liquavista non significa solo schermi a colori, ma anche pannelli in bianco e nero (sarebbe più corretto dire: scala di grigi) basati sulle stesse logiche di funzionamento ma con una riflettanza e un rapporto di contrasto davvero vicino alla carta stampata. Se un E-Ink Carta arriva al 44% di riflettanza e 15:1 di contrasto, un Liquavista fa 60% e 12:1. La carta stampata è su 70-80% e 12:1.

Kindle Textbook Creator è ora disponibile in italiano

Kindle Textbook Creator

Amazon ha rilasciato Kindle Textbook Creator, il proprio software dedicato alla creazione ed impaginazione di libri di testo e altri contenuti a scopo didattico ha ricevuto un importante aggiornamento che ha introdotto la localizzazione in numerosi paesi, tra i quali figura l’italiano, oltre a francese, tedesco, spagnolo, portoghese, brasiliano e olandese. 

Gli autori possono ora creare libri per l’apprendimento anche in lingua straniera, raggiungendo in questo modo studenti provenienti da ogni angolo del mondo. Quest’ultimi potranno usufruire dei sopracitati contenuti attraverso le applicazioni di lettura Kindle, disponibili gratuitamente per iPad, iPhone, dispositivi Android, oppure Mac e PC Windows.

La nuova versione di Kindle Textbook Creator è scaricabile a questo indirizzo.

Windows Live Writer For Windows 8.1

Windows Live Writer, developed by Microsoft, is a desktop blog-publishing application that is part of the Windows Live range of products. It features WYSIWYG authoring, photo-publishing and map-publishing functionality, and is currently compatible with Windows Live Spaces, SharePoint blogs, Blogger, LiveJournal, TypePad, WordPress, Telligent Community,, JournalHome, the MetaWeblog API, the Movable Type API, Blogengine, Squarespace, and all blogs that support Really Simple Discovery.

Windows Live Writer introduces the Provider Customization API that enables both rich customization of Windows Live Writer's behavior as well as the opportunity to add new functionality to the product. Currently Windows Live Spaces, WordPress, and TypePad have all taken advantage of this API to expose additional service-specific features within Windows Live Writer.

Windows Live Writer is currently available in 48 different languages.

wlsetup-web.rar (494.3KB)

How to Send Email Using Telnet

Sending emails with Telnet can be very easy if you know how to do it. In this article, you'll use SMTP mail Server to send email.

900px-Send-Email-Using-Telnet-Step-1-Version-2Open the cmd prompt. To open the command window, go to Start-> Run. Or press win key + R, type "cmd," and click OK.




900px-Send-Email-Using-Telnet-Step-2-Version-2Ping the server. Type "telnet 25" where "" is the name of the smtp server of your email provider (such as and 25 is the port number used by the SMTP service. (This number can be found by checking your account info in the program you normally use for email.) After you enter the above command you should receive a reply like "Trying, Connected to".

900px-Send-Email-Using-Telnet-Step-3-Version-2Specify the domain you're using to send mail. To specify the domain, type in the below command:

  • HELO (use your fully qualified domain name here).
  • You should receive a reply like: "250 Hello pleased to meet you".

900px-Send-Email-Using-Telnet-Step-4Enter your email address. Enter a space after the colon (:), and enter your email address as follows:

  • This should give you a message ending with "250 ...Sender OK".

900px-Send-Email-Using-Telnet-Step-5Enter the email address of the recipient. Type in the below command:

  • RCPT TO:
  • Note that you can enter more addresses if you intend to email more than one person.
  • You should see a message ending with "250 ...Recipient OK".


900px-Send-Email-Using-Telnet-Step-6-Version-2Compose your message. To start writing, type DATA and press Enter.

  • On the next line, type "SUBJECT: [your subject here]" and press Enter twice.
  • Continue typing your message.
  • To end your message, put a single period (.) on a line by itself, and press Enter.
  • You should see something saying "Message accepted for delivery."


900px-Send-Email-Using-Telnet-Step-7-Version-2Exit telnet. Type QUIT to exit.

Problems with partitions?

Partition Logic is a free hard disk partitioning and data management tool. It can create, delete, erase, format, defragment, resize, copy, and move partitions and modify their attributes. It can copy entire hard disks from one to another.

Partition Logic is free software, available under the terms of the GNU General Public License. It is based on the Visopsys operating system. It boots from a CD or floppy disk and runs as a standalone system, independent of your regular operating system.

Partition Logic is intended to become a free alternative to such commercial programs as Partition Magic, Drive Image, and Norton Ghost.


Partition Logic supports most basic PC hardware without any additional work or configuration.  It has very modest (by today’s standards) requirements:

  • Pentium-class or better x86 processor.  Supports all modern Intel x86 and AMD processors.
  • 32 megabytes RAM memory (16 megabytes if operating in text mode).
  • IDE (ATA) or SATA hard disks, or USB disks for partitioning.
  • IDE (ATAPI) or SATA CD-ROM drive, if booting from the CD version.
  • Standard PC floppy disk, if booting from the floppy disk version.
  • For graphics mode, a VESA 2-compatible graphics card with linear framebuffer support.
  • USB or PS/2-syle keyboard.
  • USB or PS/2-style mouse, if operating in graphics mode.


Partition logic has the following limitations:

  • No hardware support for non-USB SCSI hard disks
  • No support for Sun or BSD disk labels.
  • Cannot format partitions as NTFS or EXT3.
  • Cannot resize FAT or EXT filesystems.

Download (3,5MB)



Planet Xamarin

Planet Xamarin