How do I create a gzipped tar archive?

Putting a catalog file into a gzipped tar archive (.tar.gz) offers several benefits, especially when dealing with large datasets. Here are some of the key advantages:

Compression: gzipping your tar archive reduces the file size, which is beneficial for both storage and transfer. Smaller files take up less space on your servers and require less bandwidth to upload, making the process faster and more efficient.

Single file: a tar archive combines multiple files into a single file. This is particularly useful when you have multiple catalog files (for example, items.csv, item_groups.csv, variations.csv) that need to be uploaded together. It simplifies the upload process by reducing it to a single file transfer instead of multiple uploads.

To create a gzipped tar archive, follow the instructions below based on your operating system.

Unix and Linux based systems (macOS)

  1. Open a terminal
    On OS X, you can find Terminal in the Applications folder under Utilities, or via Spotlight (command + space and type "Terminal").
  2. Navigate to the directory
    Use the cd command to navigate to the directory containing the files you want to compress into a .tar.gz file. For example: cd /path/to/your/directory
  3. Create the .tar.gz file
    Use the following command to create a gzipped tar file: tar -czvf <archive_name>.tar.gz <files_to_include>
    Flags utilized in preceding command:
    -c Creates a new archive
    -z Compresses the archive using gzip
    -v Toggles verbose mode to show progress
    -f Allows specification of the archive filename
    Replace <archive_name>with the desired filename, we recommend referring to FTPS connection and transfer details for detail on file naming when uploading catalog data to Constructor.
    Replace <files_to_include> with the names of the files to include in the archive. You can also utilize wildcards (*) to include multiple files. For example:
    • tar -czvf example.tar.gz *.csv
    • tar -czvf example.tar.gz items.csv variations.csv

Windows

Using Command Prompt

Command Prompt may be utilized to create a .tar.gz archive on Windows. You can find it by typing cmd in the Windows search bar and selecting Command Prompt.

Then, follow steps 2 and 3 as shown within the Unix and Linux based systems instructions.

Using 7-Zip GUI

If you prefer to utilize a GUI, you may choose to use the 7-Zip file archiver to create .tar.gz files:

  1. Select the files you want to archive
  2. Right-click to bring up the context menu
  3. Under 7-Zip, select Add to archiveā€¦
  4. Type in the desired filename - we recommend referring to FTPS connection and transfer details for detail on file naming when uploading catalog data to Constructor
  5. Select tar under Archive format
  6. Select GNU (gzip) under the Compression method
  7. Click OK