2010-06-13

Copying VirtualBox virtual hard drives (VDI)

Ok, so you have a virtual machine with 1 or x number of hard drives, and you want to copy them into a new virtual machine so you now have 2 parallel systems. You can't manually copy the underlying .vdi file... you must clone them. After you do that, you simply create a new machine and attach the hard drives' copy.

Before you run this, open the original virtual machine and de-attach the hard-drive(s) you want to copy. After you are done copying the file (using the statement below), then re-attach the original hard drive to the original virtual machine.


COMMANDLINE$ /usr/bin/VBoxManage clonevdi '/home/YOURPROFILEUSERNAME/.VirtualBox/HardDisks/ORIGINAL_HARD_DRIVE_NAME.vdi' '/TARGETFOLDER/.VirtualBox/HardDisks/NEW_HARD_DRIVE_NAME.vdi'

2010-04-22

TSQL - Database backup with compression

The scripts below contrast a typical backup script, versus one that uses compression. You might want to consider compressing to save space.


Typical backup script:

BACKUP DATABASE xxx
TO DISK = 'C:\Backup\xxx.BAK'
WITH FORMAT,
MEDIANAME = 'C_Backup',
NAME = 'Full database backup of xxx';


This one compresses your backup, saving you, in my experience, about 75% of the space (an 800 MB dbase compresses, typically, to around 200 MB).

BACKUP DATABASE xxx
TO DISK = 'C:\Backup\xxx.BAK'
WITH COMPRESSION,
MEDIANAME = 'C_Backup',
NAME = 'Full database backup of xxx';


Compatibility tested on: MS SQL Server 2008 Standard.

SharePoint - Calculated month name

You can create a new calculated column (calcualtion based on other columns), and display the year, name of the month, etc. This is really useful for when you create views that group by year and/or month.


This formula gives you the name of the month, based on an existing data column in your list/library.

=TEXT([Modified],"MMMM")


This formula, will give you the name of the month, prefixed by the month number, from any date column in a list.

=IF(MONTH([Modified])<10,"0","")&MONTH([Modified])&" "&TEXT([Modified],"MMMM")


This one gives you the year, as a text. This helps so that the year doesn't get formatted as a number, with a comma.

=YEAR([Modified])&""



Tested compatibility: WSS 3.0.