Backup data, Windows 10

From Andreida

Goal

  • We want to connect an USB hard disk and backup our data to it with the least work that is possible.
  • We want to have a certain number of revisions where older ones are not kept to have enough space for more backups.
  • We want to be able to get data from the backup without having to go to university.
  • We want it cheap.
  • We'd prefer an easy setup
  • We'd prefer at least some kind of compression to save some space.

Get the backup program


Consider the portable version you can get when you buy it with a donation... yeah... right. Whatever. But really consider it. You can have a backup disk that can backup without you having to install anything on your PC.

Prepare the hard disk

The Connection

  • Connect the USB hard disk to your PC
    • Use a connection which is working
      • Some USB 2.x hard disks do not work well from USB hubs, but must be connected directly to the PC. In most cases this happens when the disk does not have its own power supply.
      • If you are a rich/lucky/thoughtful bastard you'll have a PC with USB 3.x and an USB hard disk with USB 3.x. First: I hate you! Second, use the correct port on your PC to really use USB 3.x.
    • Make sure it is a position where you can connect easily each time you want to do a backup.
  • Remember where you connect the USB hard disk, you should use the same USB port for the same device as often as possible. That is of course only if you want things to work more often.
  • Consider getting an USB hub which can enable/disable ports individually. Only enable your backup disk when you do backups.

Formatting the USB hard disk

  • Right click the Windows Start button
  • Select "Disk Management"
  • Find your USB hard disk
    • If you don't see it "Menu/Action/Rescan disks"
    • If you still don't see it, consider to use a different USB port on your PC.
  • Make ABSOLUTELY sure you look at the correct disk!
  • Right click the disk to get the context menu
    • Select "Format..."
      • Volume label: Backup
      • File system: NTFS
      • Allocation unit size: Default
      • Perform a quick format: yes (consider "no" here, IF you have the time. If the last real format was a long time ago or never, use "no")
      • Enable file and folder compression: yes (make sure this is active, because we will not use any compression later)
      • Press "ok" and format the disk.
      • A USB 2.x USB disk with 2 TB took something like 6 hours for me when I did not use the quick format but the real format. USB 3.x should be way faster. Way way. :-)
  • Wait until the format is done. With quickformat we are talking about seconds, normal format takes minutes to many hours.
  • When you select a letter for access to your USB disk (context menu/change drive letter and paths...) keep in mind you will perhaps in 2 years connect the USB disk and not remember what it is. Don't do fancy stuff like B: for backup or D: because it is near C: or whatever crazy things people think. Use a letter late in the alphabet so no other connected devices will use it. In the following we will just assume you used Z:.


If you use a disk with more than 2 GB AND are having trouble: Convert disk to GPT.

Prepare the files and file structure

  • The USB hard disk should now be empty (if you see "System Volume Information", ignore it)
  • Copy the "FreeFileSync_xx.x_Windows_Setup.exe" to the root of your USB disk, Z:\
  • create the following folder structure: (desktop-data is just an example for the first backup you prepare. Even if you currently don't expect to use this hard disk for other backups, prepare for the unlikely case that things happen and do it my way.)
Z:---backup----desktop-data-----C------current
                     |          |------revisions
                     |
                     -----------D------current
                                |------revisions                      

You should not need this but just in case you do not use TotalCommander(why?):

Z:
cd \
mkdir backup
cd backup
mkdir desktop-data
cd desktop-data
 
mkdir C
cd C
mkdir current
mkdir revisions

cd ..
mkdir D
cd D
mkdir current
mkdir revisions

Backup

  • Start FreeFileSync (NOT the setup, the one you installed on your PC)
  • It should look like the follwing:

FreeFileSync-Overview-01.jpg

  • In (2) you now browse to the directory you want to backup
  • In (3) you now browse to "Z:\backup\desktop-data\C\current".
  • Press the cogwheels in (2)
    • Select a variant: "File time and size" (should be default)
    • Ok
  • Press the cogwheels in (3)
    • Select a variant: Mirror
    • Delete files: Versioning
    • Naming convention: Time stamp(Folder)
    • Move files to a user-defined folder: "Z:\backup\desktop-data\C\revisions"
    • Maximum: 5 (here you can use what you need, perhaps you prefer "last x days"?)
    • ok
  • In (1) select the last icon ("Save as batch job...")
    • Save as...
    • Z:\backup-desktop-data.ffs_batch (yes, directly in the root)
    • save
  • close FreeFileSync
  • use your TotalCommander/FileExplorer/Whatever to browse to Z:\ and double click "backup-desktop-data.ffs_batch"
  • Wait until you get the success message (depending on data size and USB 2.x or USB 3x from seconds to days)
  • Check the folder "z:\backup\desktop-data\current\"

Now you should have a mirror of your data on a compressed drive where you can update the mirror and keep a number of revision with a simple double click.

Perhaps you'd prefer to not have your backup disk connected to your PC all the time. You know ... viruses don't do "oh, it's the backup disk, I'll not touch it then".

Misc

Run script before backup

If you want to run a script before the backup, for example to dump svn repositories do a directory which will be part of the source for the backup, then look no further:

  • Create on your USB disk a bin directory, for example Z:\bin
  • move the backup-desktop-data.ffs_batch and the .exe installer into the bin directory
  • create inside the bin directory something like "Z:\bin\dump-svn.cmd":
@echo off
svnadmin dump D:\data\repos\svn\personalData > D:\data\repos\svn\_dump\svn-personalData.dump
svnadmin dump D:\data\repos\svn\src > D:\data\repos\svn\_dump\svn-src.dump
echo - all svn repositories have been dumped -
  • make sure dump-svn.cmd works as intended
  • create in the USB disk's root directory a script like backup.cmd
@echo off
cd bin
call dump-svn.cmd
call backup-desktop-data.ffs_batch
  • Double click the backup.cmd to do backups from now


multiple sources, overlapping names

If you backup C:\work and D:\work then you will get problems. So do not backup to "Z:\backup\desktop-data\current", but instead to "Z:\backup\desktop-data\current\C" and "Z:\backup\desktop-data\current\D" etc.

Problems during restore

too long paths

If files can not be restored because of "too long paths" or something like that: http://wiki.andreas-duffner.de/index.php/Windows_10#Long_Paths


But the above is more like a workaround, not a solution. The solution would be to fix the original, so that you don't have such filenames. You should really do it. It is no fun to have a backup which is not 100% usable.

Fix the original data(paths) until the backup can be copied somewhere without ANY warning or error.

Lazy?

You want it easier? Buy the portable version and copy it to the backup disk. Don't even install the normal version on your PCs or laptops. Just create your scripts knowing that you are calling a local portable version and you only connect your USB disk, go to the backup.cmd and double click it. No need to have the backup software on the current PC installed.

Prepare for more backups?

If you want to be prepared, you can try this:

Folder structure

Z:\--------FreeFileSyncPortable (contains the portable version of the backup program)
  |--------FreeFileSyncPortable.scripts (contains all these .ffs_batch batches you create with "save as")
  |--------R-W10-NAME1 (backup of the PC with that name)
  |--------R-W10-Laptop (backup of your laptop)
  |-------backup-R-W10-Name1-data.cmd  (executes the script for backup of R-W10-Name1 with context data)

backup-R-W10-Name1-data.cmd would have to look something like this:

FreeFileSyncPortable\FreeFileSync.exe FreeFileSyncPortable.scripts\BatchRun-W-R10-Name1-Data.ffs_batch

Now, you connect to your USB, look in your backup directory and doubleclick the correct *.cmd.

Testing the backup

You will want to know if your backup is really working. This is so easy :-) Just copy the content of the "current" folder somewhere. If it works, Windows could read all the files. If it does not work... yeah... you have a problem which needs fixing.