File backup : PowerShell and Robocopy

The PowerShell here just wraps the RoboCopy functionality. Code.


But if you just want to keep it real simple, for a basic do-it-all backup, do this…

Robocopy.exe c:\temp d:\tempxxx /E

, where c:\temp is the root/source directory to copy, including subfolders, d:\tempxxx is the target directory, which does not need to exist when you execute the copy, and /E says “also create any empty folders you find in the source.



SqlServer backup and restore

Useful commands…


— restore options

USE master;
EXEC sp_addumpdevice ‘disk’, ‘mydiskdump’, ‘F:\ssistemp\BikeRides.Bak’;

select * from sys.backup_devices


restore database BikeRides
from mydiskdump
move ‘BikeRides’ to ‘f:\database\data\BikeRides.mdf’,
move ‘BikeRides_log’ to ‘f:\database\logs\BikeRides_log.ldf’


iTunes: moving computers

Intuitive. Easy to use. Sure, they’re synonyms. As someone who tends to restrict their use of Apple products to music and podcasts, I’m normally prepared to accept that those products do their job well, with a minimum of fuss, as I have no evidence to the contrary.


But sometimes

I moved laptops recently. As I’m starting to use Spotify a bit more than my iTunes library, I was in no immediate rush to transfer. Came the day, I googled for how to transfer the library. Found this page, i.e. an Apple support page, even though on previous use, I had found there was some assumed knowledge, as though all users were regular Mac/iPad etc users, familiar with the detail. But fine.

A library transfer consists broadly of two steps, of course: a backup, and a restore. I read through the instructions on the page, and set about doing the backup. The backup, to my external hard drive, went swimmingly. They’re always great, those backups, aren’t they.  I did a sample check that, yes, there was a parent iTunes folder, yes, there are the subfolders I’m expecting, all great. Still no rush to do the restore. Today, I decided, It’s Time. Follow the instructions for the Restore. Of course, you might review all of the steps looking pro-actively for gotchas before you start the  backup, even. But until you actually perform the steps, you don’t necessarily realise there is a gap. To wit…

“Then choose the iTunes Library file inside.”

Oh, a) what is that? b) couldn’t you have asked in the Backup steps to check it was there?

Ref a) it took no time to understand it was a file with a suffix of [.itl]. Yes I had some on the disk… but not the one I needed, so consequently I have to go and redo the backup (The symptom btw was that the titles appeared in iTunes… but iTunes could not locate the files themselves). Ref b), well that would have been answered by doing a better, more pro-active job with a).

It will wait until another day, but I do find the Apple Help rubbish sometimes. In fairness, that may be no worse than Windows Help.