Which Files Should I Backup When Backing Up a Unity Project?


Which Files Should I Backup When Backing Up a Unity Project?

 Hello friends, in this post I will talk about how you should backup a Unity-coded game when transferring or backing it up to another computer.

You can directly copy project files and transfer them to another computer or external storage device to back up your project, but some games can get really huge in size, causing significant problems in storage and backup.

When backing up our projects to systems like Github, internet and time waste become additional problems. Anyway, without further delay, let me explain how you should back up your project.

First, go to your project's folder (Do not make any changes to your project during the backup process, in fact, make sure your project is closed.)

Unity Project Backup 0

When you enter your project folder, you will see files like in the image above; knowing what these files are for is very important.

  1. .vscode: This file is automatically created by the editor/IDE you use to write code in your project and is not needed during backup. 
    1. You can delete it when backing up.
  2. Assets: This is the folder that contains scripts, prefabs, sprites, and such objects for the game.
    1. You should never delete this.
  3. Library: Contains the files necessary to build your project, and is regenerated every time you change build settings or the platform. 
    1. This is the folder that takes up the most space. 
    2. You can delete it when backing up.
  4. Logs: This folder stores details like error logs from the game. 
    1. You can delete it when backing up.
  5. Obj: Temporary files kept to run the game in the editor. 
    1. You can delete it when backing up.
  6. oyunDemo: I put this here when building the game, it contains the built version of the game. 
    1. You can delete it when backing up.
  7. Packages: Contains plugins and AssetStore objects added to your project; if you haven't installed any external packages, you can delete it. 
    1. Be careful: If you have installed an external package, never delete this.
  8. ProjectSetting: The folder that contains information such as the name of your project.
    1. You should never delete this.
  9. UserSettings: Contains build settings you made in the project and files that store data such as version codes.
    1. You should never delete this.
Except for the ones highlighted in green above, every file in the project folder can be deleted.
You need to be careful with the file I marked orange.

Now let's check the difference in backup size when we delete these files.

Unity Project Backup

As you can see, after the above adjustments, our backup file, which was 30mb, is now shrunk down to 45kb.
With this method, you can really save space with your projects and perform transfers much faster.
As for the disadvantage of backing up this way, even on the computer on which we first created the project, it will recreate the Library folder, so opening it for the first time will take a long time.

Note: If you are going to transfer your project to a new computer, be sure to delete the Library folder before transferring. This will allow a more efficient transfer.
The Unity Library folder is created specifically for the PC it's being used on, and if the Library folder is not deleted when transferring the project to a new computer, you may encounter problems if the two PCs are not similar.

Note2: Please be careful while following these steps, and if there are files in your project not listed above, avoid deleting files you are not sure about.