I was careful not to put the magic Eeeeew word in the title: BACKUP!
Soooooooooooooo often someone stops by and we can only ask: did you make a backup? You do have a backup, right?
Seriously, frickinā seriously, just do it! Close your project, copy it elsewhere or zip it up. At least daily. Donāt overwrite the previous archive, keep several. Thatās the bare minimum solution!
But other than that, once you really, seriously put some effort in where you work on a project that you intend to work on for months and hopefully will publish, then be sure to ā¦
Use Version Control
What version control does for you is NOT the same as a backup! Instead, it keeps a record of every frickinā change you ever made!
Provided you check in often and in small doses, it becomes easy to debug issues. Particularly the nasty ones. You can āgo back in timeā and see how the two-days-old version of the project behaves and whether it has the same issue.
Although itās rarely needed because more often than not, you can just scroll through the changelist, view the changes you made, only to realize: āOh right, I changed that thing here!ā. Quite often thatās all you need to know.
The most commonly used VCS are Unity Version Control and GitHub (git). For git, itās best to use a GUI tool like GitHub Desktop or SourceTree.
The terminology and workflow can be offputting, so I wouldnāt recommend using source control as an absolute beginner. It does however become mandatory when working with other people on the same project. To that end, a word of ā¦
CAUTION: Do not Cloud Sync your project!
Cloud sync, any form, be it SomeDrive or SomeBox, all share the same principal flaw when sharing files: they can be overwritten, or synchronization fails to complete and you start working with an incomplete set of files.
For individual documents thatās easy to spot. For a complex Unity project this can be disastrous and quickly lead to loss of work, possibly even corrupting scenes or the entire project without recovery (unless you have a BACKUP ).
This can happen even to a solo user - but for two users, youāre almost certainly going to destroy each otherās work. Hence why you need Version Control!
Cloud Backup? Live Backup?
Ugh, isnāt cloud drive sync a backup? Yes, but NO!
A cloud drive will typically sync every changed file asap. However, a single file change while you still have unsaved data in memory means the cloud version of the project may not actually be fully functional. It keeps changing between the state of completely synced and ācorruptā so to speak. On top, it keeps synchronizing even the temporary cache files that Unity generates which are typically several times larger than your Assets folder.
For that reason, no matter how or where you make a backup, it is absolutely crucial to close the project before you start the backup. And you donāt open it again until the backup is complete. This is why any backup tool that runs on a schedule is not suitable to backup your Unity projects either! Unless you can set it up so that the backup runs when you arenāt using the Unity editor, such as when the computer shuts down.
Ideally, just like Version Control, you exclude certain subfolders from the backup to save on time and disk space. At least: Library
, Obj
, Temp
, Build
or Builds
.
Poor Manās Backup
In its simplest form, you can simply use 7-Zip to create an archive of the project folder. You can relatively easily write a batch or bash script to back up each project.
Preferably choose uncompressed or with low compression because this will be a lot faster (like several times!). Be sure to exclude the folders mentioned above or else the backup will take significantly longer too.