Tag Archives: Backup

SQL Backup and Restore Commands

Some useful code snippets for backing up and restoring data in MS SQL. Create full backup: (also output times for reference) select {fn Now()}  as ‘Start Time’ BACKUP DATABASE DBNAME TO DISK = ‘d:\DBNAME.bak’ WITH INIT select {fn Now()}  as …

Read more »

mySQL Restore Batch File / Script

I got bored typing mysql commands so wrote a little script to keep on my box for easy access to restore databases from .sql files. It’s very simple and may not be any use to anyone. It also stores the …

Read more »

3G WAN Failover using PFsense

We’ve had a few internet issues lately in the office, mostly occurring late in the afternoon when the internet will just drop. I’ve been on the phone to Zen a lot and the cause is noise on the line, but …

Read more »

Script to 7-zip all files and then delete the originals

I wrote a while back about a script which would go through my backup directory and 7-zip my .bak and .sql files and then delete the originals, so that they were much smaller to then backup to my elephant drive. …

Read more »

Moving and Sharing Files with Dropbox

I came across a handy service today called Dropbox. You can download it here, for free. It’s a great way to sync files between your many devices (PC, Laptop, Netbook, Mac, PDA etc). It  creates a folder in your “My …

Read more »

Restore a MySQL Database Backup from the .sql File

I’ve written a bit on backing up data and have been asked how to restore data to MySQL. Pretty simple, assuming you have your backup file, just run: “C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql.exe” -uUSERNAME -pPASSWORD DATABASENAME < “c:\BACKUPFILENAME.sql” On the box …

Read more »

Online Backups with ElephantDrive

We currently have a few externally hosted dedicated servers that are through a pretty reputable company and we have had these for a couple of years now with no problems. All the machines have RAID and all the data (both …

Read more »

Script to backup MS SQL Server Express Databases

This is a bit of SQL I use to backup Microsoft SQL Server Express Databses (the free version from Microsoft that doesn’t have all the functioanlity of the full M$ SQL Server). There’s a bit more to it than the …

Read more »

Simple Script to backup MySQL Databases

This is a simple script I use to backup MySQL databases. Save the following as backup.bat (or similar) and they you can set a scheduled task to run this daily. “C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump.exe” -uUSERNAME -pPASSWORD MYSQLDBNAME > “c:\folder\mysqldbname\mysqldbname_%time:~0,2%%time:~3,2%%time:~6,2%_%date:~-10,2%%date:~-7,2%%date:~-4,4%.sql” The …

Read more »