Importing Locations

The signature for this is:

php artisan snipeit:import-locations {filename}

This importer will look in the storage/private_uploads/imports directory for your file, so you can just upload it using the Assets/Licenses/Etc importer, but call it directly from artisan.

It will update existing fields based on the values in the CSV.

The column names can be in any order, but they MUST be exactly:

NameCurrencyAddress 1Address 2CityStateZipParent NameCountryOU

Additional included fields will not be imported.

This walks through the CSV records and first creates a "stub" of the parent locations, creating a record for their name if there is no matching name already in the locations table. It then loops through the CSV rows again and adds/updates all of the location records, which will also update those newly created parent stubs with their address, etc information if it's provided in the CSV.

If you blank out any of the information in the CSV for an existing location, it will blank out that value in the database for that location. If you don't want that to happen, you should make sure your CSV has correct, complete data or omit the column. (Name is obviously still required, but it's the only required field.)

We'll be building in support for importing via the normal GUI updater at some point in the future, but this was a tool we needed, so we shipped this as is.