---
title: Automatic library organization
url: https://photostructure.com/getting-started/automatic-library-organization/
description: Learn about PhotoStructure's automatic organization feature.
date: 2020-07-08
keywords: library, disk
---


If your photos and videos are scattered everywhere, PhotoStructure can bring order to your chaos.

If you'd like all your photos and videos to be organized into one, tidy place,
choose "Yes" on PhotoStructure's settings page:

{{< figure src="/img/2020/07/auto-org.png" caption="Screenshot from PhotoStructure's settings page&nbsp;" >}}

## ✅ What happens when you choose "Yes"

- Photos and videos are automatically checked for
  [corruption](/faq/how-do-i-safely-store-files/#why-3-2-1-isnt-enough-the-impact-of-bit-rot)
  before being imported into your library.
- All [**unique**](#unique) photos and videos will be [**copied (not
  moved)**](/faq/why-doesnt-photostructure-move-original-files/) into
  date-stamped folders, like `2019/2019-05-01`, and retain their original
  filename.
- Photos and videos _already_ stored in your library directory hierarchy will
  _remain_ in their current location, and not be "re-copied" into a date-stamped
  folder.
- Different files taken on the same day that share the same name will be given a
  unique number suffix.
- Your library will need to be on [**a disk with enough free space to store all
  your photos and
  videos**](/how-much-disk-space-do-i-need-for-my-photostructure-library/).

## ❌ What happens when you choose "No"

- Files on your hard drives will remain where they are.
- You still need to ensure the drive holding your library has sufficient free
  space for preview images and transcoded videos.
- If you eject any volumes after importing them:
  - Zoom may not work for images (as that requires access to the original photo)
  - Videos may not play (unless they were transcoded)

## 🔄 What happens if I change this setting later?

If you change the value in the settings page from "no" to "yes," the next sync
will result in all new photos and videos not already found in your library to be
copied into your library. Syncs happen automatically daily (but is [configurable
via
`syncIntervalHours`](/getting-started/advanced-settings/#library-settings)).
You can also run a sync immediately via the main navigation menu.

If you change the value in the settings page from "yes" to "no," PhotoStructure
will [not remove any
files](/faq/why-doesnt-photostructure-move-original-files/)
that were previously copied into your library.

<a id="assetSubdirectoryDatestampFormat"></a>
<a id="assetPathnameFormat"></a>

## ⚙️ How is this configured?

Automatic organization is enabled via the `copyAssetsToLibrary` [system
setting](/getting-started/advanced-settings/#system-settings).

The format of the subdirectory is configurable via the
`assetSubdirectoryDatestampFormat` [library
setting](/getting-started/advanced-settings/#library-settings).

If you're using [version 2.1](/v2.1), you can use the more powerful `assetPathnameFormat` setting. [See this forum post for details.](https://forum.photostructure.com/t/how-to-change-the-naming-structure/1184/2)

## ❓ I changed `assetSubdirectoryDatestampFormat` and it didn't do anything (!?)

If you change this setting after your first import completed, know that running
`sync` or `rebuild` _won't do anything_, because of the following:

1. PhotoStructure [never moves
   files](/faq/why-doesnt-photostructure-move-original-files/)

2. Automatic organization only copies _unique files_ found _outside of your
   library_ into these subdirectories

So, after an import, all your photos and videos will have been copied into your
library already, and rule #2 above will prevent PhotoStructure from moving them
into your beautiful new directory name.

This rule was added because people like to be able to rename directories from
simply a datestamp to "datestamp-event name". If rule #2 wasn't in place, this
work would be undone by PhotoStructure.

The solution is to move all incorrectly-named-directories and their contents to
a folder that is outside of your library, re-import that directory, and
PhotoStructure will then create new folders based on your new
`assetSubdirectoryDatestampFormat` template.

<a id="unique"></a>

## 🔍 What do you mean by "unique files"?

There are many reasons why you may have "duplicates" of library assets, where an
"asset" is a photo or video.

These "duplicate assets" come in two flavors:

1. **Exact copies** of an asset (like from a backup)

2. **Variations of that asset** (like from an edit, a different file format, or
   [other
   reasons](/faq/what-do-you-mean-by-deduplicate/#why-you-may-have-duplicates))

**Each unique variation of an asset will be copied into your library.**

In other words, PhotoStructure doesn't copy the exact same file into your
library more than once.

As PhotoStructure imports your photos and videos, it can't be sure that any
"variant" of an asset is the "best," so to be safe, it copies every unique
variant into your library.

This behavior can result in "duplicate files" showing up in your library
directories. Although they may share the same filename, the contents of each
file will be unique.

These variants are de-duplicated within your PhotoStructure user interface. You
can see which variants have been aggregated into a given asset by using the
asset info panel (tap <key>i</key> when viewing a photo or video full-screen).

If you want to remove these non-"best" variants from your library, we do have [command line
tools](/server/tools/#show-me-all-the-duplicate-variant-filenames-for-each-asset)
to help you do this, but please note beforehand:

- _we don't recommend doing this_,

- _take a full system backup before starting_, and

- _verify that PhotoStructure really has picked the "best" asset_.

The [heuristics to pick the "best" variant may not be what you
expect](/faq/what-do-you-mean-by-deduplicate/#how-does-photostructure-pick-which-file-to-show),
and I don't want PhotoStructure to cause data loss (especially when disk space
is so cheap these days!).

