How to Backup Unity Projects

Unity projects need to be backed up.

There’s a lot of options and lot’s of questions to ask yourself.

The big question is…could you recreate your project from scratch if something happened to it?

Does your Design or Build documentation cover off every tweak and setting of all your scenes, objects, and prefabs?

What about using a Unity Plug In?
Or Custom Scripts?
Also what do you neeed to Backup?

If you’re using Source Control like SVN or GIT what do you exclude in your exclude file?
What does Unity say?
What about Unity users in the forums what is their advice?

Backup Options

Let’s start with some options for backing up Unity Projects.
I’ll list the one’s I’ve looked at here:
1. Manual backup of your Unity Project Folder
– That’s right. Just copy the whole root project folder somewhere else.
It’s quick and dirty but reliable. Even better if you copy to another location off your workstation.

2. Your project can be placed under source control.
– The Unity Manual says that Unity supports version control integration with Perforce and Plastic SCM.
– I’ve tried Perforce and it was a little difficult to set up and I can’t say I really got some of the key concepts behind the product but it looks like standard source control and seems to work.
– I didn’t try Plastic SCM as it didn’t seem as well integrated or supported
– GIT is an easier beast to work with I found.
– Unity have advice on using external source control software like SVN for your project files and code.

3. You can use the Unity Editor to work in the Cloud
– There is a button called Collaborate! Just click it.

When you open up your Projects page in Unity you can see the one’s in Cloud storage here:

The features of the Cloud storage are here:
You don’t get much for a free account – but it’s not that expensive and if you have a good internet connection it’s very reliable.

4. In the Asset Store there is (or at least used to be) a Unity Asset Repository product.
– It seems to be discontinued so I won’t dwell on that.

5. There is also a whole slew of Tools and Products up there in the store to help with managing Version Control. There are Backup Products in the Asset Store like Zip Backup and Backup Project.

I’ve never used any of these so I won’t comment on that either. There are plenty of reviews on the Asset Store so I guess if you’re interested you can read them.

6. If you want automatic regular backups on a Mac you could use Time Machine.
On a Windows box you could also schedule backups with File History and/or Windows Backup and Restore.
Another alternative that works on anything is DropBox.

7. Finally – there are of course dedicated Backup Solutions ( think NetBackup ) out there – maybe you are already using one.

What to Backup?

So the next question is what in your Unity Project Folder do you need to back up?
The short answer is the Assets and Project Settings only.
The Library, Temp, Obj, .SLNs and .Proj will be regenerated.

But the long answer has a few other folders that you might have created for your project.

The base folders that all projects get when initiated are: Assets, Library, & Project Settings.

Assets is where the majority of your work will go but you could also use any number of other special folders like:
Editor Default Resources
Standard Assets
Hidden Assets

There is also a Temp folder which sometimes has it’s uses to keep a copy of.
(See my blog post on recovering a corrupted scene – DO NOT RESTART UNITY before taking a backup!)

So what folders need to be backed up?
Assets definitely – but everything in there? What about .meta files.
Meta files are created for every asset and are visible in the explorer of your operating system but not by default visible in the Unity Editor.
The Meta file has a reference to the Unity ID code assigned to the object. If you lose your meta file you lose all the references to your objects in the editor and have to relink everything.

The Library folder is analagous to the Unity cache. It’s a dynamically loaded set of data that Unity creates for your project. Each asset in your Asset’s folder is converted into a Unit Readable data format in this folder so that it can be dynamically played with in the editor. Normally as a user you would not need to do anything with the contents of this folder and it’s not necessary to back it up as it’s able to be regenerated every time Unity starts up your project.

The Unity Manual says:
When backing up a project, or adding a project to a Version Control Repository, you should include the main Unity project folder, containing both the Assets and ProjectSettings folders. All the information in these folders is crucial to the way Unity works. You should omit the Library and Temp folders for backup purposes.

I guess one of the bottom lines of this post is: Use Version Control.
But are version control and back ups two different things? I say yes.

Version Control is a point in time file based recovery of your work but Backups are a whole system recovery for when things really go boom! Like when your laptop gets dropped off the balcony.

So if you are using Version Control you also need to use an ignore file so you don’t have to backup stuff that you don’t need to back up.

There are some really awesome flame wars in all sorts of forums arguing for and against .gitignore files. This reddit link is really funny if you like reading passionate people and idiots talking to each other on the internet.

A .gitignore file tells Git which files/folders should not be in the repository. It is usually used to avoid committing transient files or files that can be reproduced (like those in the Library folder).

When you create a new repository on GitHub. There is a dropdown that lets you choose a .gitignore file and they just happen to have a Unity one available. Just grab a copy of it and stick it in the main folder of your Unity project.

I commit to the repository every time I have made a big change. This lets me revert to any previous commit if necessary. The downside is that unless you feel like paying, your repository will need to be public, meaning anyone can see your project.

If you don’t want to use the terminal, you can also download Github desktop which gives you a simple and clear interface to handle your repositories.

The is the easiest way to work with Git. It is simple to create a repository by draging your Unity folder into the and add your .gitignore file. It only takes seconds and will save your butt.

There are other choices for a source control browser:

Before checking your project in, you have to tell Unity to modify the project structure slightly to make it compatible with storing assets in an external version control system. This is done by selecting Edit->Project Settings->Editor in the application menu and enabling External Version Control support by selecting Visible Meta Files in the dropdown for Version Contr

I’ve read from various forums that people have been backing up by creating an empty game object and parenting all other objects under it. Then they will create a prefab out of this and export the object and scenes at the same time. It kind of makes sense for an easy restore of your objects as all you have to do is import that prefab into a project to do a restore.
Obviously this is no good if you got lots (like thousands) of objects and assets. You will lose things like layer names, tags, and other Project settings. Plus you might as well just copy the Project folder. Exporting packages is useful thing, but it’s not a substitute for a proper backup.

When you do backup make sure you get all the metafiles. The files are used to keep track of everything in the project and their locations. They are hidden by default, but can be made visible by going into Edit | Project Settings | Editor Settings | switch Version Control Mode to Visible Meta Files.

That’s about it for backups – I guess the bottom line is – if you are not backing up…

Please do!

The Kit

This is the hardware and software that I’m currently using to make games.

My main machine is a Venom BlackBox laptop. It’s got an i5 Intel Core and 8 GB of RAM. The OS c:\ drive is flash and the d:\ storage drive is SAS. so the operating system stays fast but it also has plenty of local storage. This was my main expense and after working for years on a 3nd hand Toshiba it’s an absolute dream. They are made locally in Melbourne at a place called MLN Computers who specialize in Gaming Hardware and it’s just beautifully finished and super thin and light. Plus it’s Batman black with green backlit keys if you want them. Off mains it’s a bit of a battery hog but for what I do on it and the process heavy apps I use it does pretty well. It gives a lot of power and is very stable. The only down side is because it is very thin the fan comes on quickly and can be loud to the point of distraction sometimes.

I do a lot of music and audio work on my laptop and use a Line 6 KB37 midi keyboard and digital USB audio interface. I got this years ago and its been super awesome. It come bundled with the Line 6 Pod Farm software and a bunch of other audio apps like Reason 10 and Ableton Lite and virtual instruments from Korg (the amazing Korg Legacy Collection), and Applied Acoustics (the fully versatile AAS Player and gorgeous LoungeLizard EP-4). Sadly it’s no longer made and I have no idea what I’m going to do if it ever gives up the ghost – probably go back to Linux Audio (sadly the KB37 was incompatible with my Linux audio box if you ever get the chance to play with it I recommend Musix or Ubuntu Studio but there are heaps of other options).

For either guitar or keyboard it’s fabulously versatile and can also interface with whatever Daw I’m using.

I bought a second hand Wacom drawing tablet. When I picked it up it turned out to be an old one from one of Melbourne’s larger game companies. I took that as a good sign.

I started making games in htlm5 and all I really needed for software was a copy of Sublime Text 3, Gimp and the Tiled map editor.

I moved on to Unity3d and Visual Studio 2017 but still use Gimp as my main art making software.

I tried lots of other art packages like Spriter, Krita, Pencil,  Adobe Illustrator CS2, Adobe Photoshop CS2, and GraphicsGale.  All of them were good but I like Gimp best. It seems to have all the features that I need and I’m more comfortable with the open source nature of the project.

I tried lots of other Game Engines as well: Stencyl, Unreal Engine and Amazon Lumberyard but I think I’ll stick with Unity for a while.

For model making I use Blender. I find it easier than the other programs I’ve tried (even with all the keyboard shortcuts).  The community is awesome too.

I also really like using  MagicaVoxel for quick fun models.

I tried DAZ Studio, DesignDoll and Sculptris but I always come back to Blender.

For animation in 2D I use Plastic Animation Paper (PAP4 ) and Gimp.  I really like PAP4. It’s old but has very powerful features.  I use Blender for 3D Animation.

For making video content and editing I use the OpenShot Video Editor.

All my documentation is done with OpenOffice.

For Source Control I use GitHub and TortoiseSVN, or a local Helix Perforce service.

For an Android emulator I either use Android Studio, KOPLAYER or Leapdroid.  I think Leapdroid is my favourite.

I have a really really big list of software that I tried and never really used. Mostly because I just never got time and if I spent all my time getting new toys I wouldn’t have time to play with the ones I already have.