HOW TO

Delete Tile Cache Data Store Backups

Last Published: July 25, 2022

Summary

The deletebackup utility is a utility that deletes Relational Data Store and Graph store backups. However, it doesn't delete Tile Cache Data Store backups, which is a known limitation addressed in the following enhancement that is currently in the product plan and will be taken into consideration in future releases:

ENH-000119436 : Enhance ArcGIS Data Store to provide the functionality to delete backup files created for tile cache data Store using the deletebackup command utility)

Until then, there is still need to delete Tile Cache backups, as described in the following steps.

Procedure

To delete tile cache backups:
  1. Use the listbackups ArcGIS Data Store utility with the --store tileCache parameter to list all the tile cache backups (Backups Name, Status, Backup Tile, and Mode), as well as where they reside. The tile cache backups location is by default in the following path: C:\arcgisdatastore\backup\tilecache.
  2. Copy the Backup Name that you want to delete.
  3. Browse to the tile cache backups location and open the "index" file with a text editor such as Notepad.
  4. Search for the copied Backup Name and delete its entry.
  5. Save the changes.
  6. In the backups location, search for the file named the same as the copied Backup Name and delete it.
  7. Use the listbackups --store tileCache command and note that the deleted backup is not mentioned.

You can also implement the previous steps using the Python script below.

Please note the following before using the Python script:

  • The BackupsPath parameter that exists in line 3 of the script must be changed to the tile cache backups location.
  • When the script is run, it prompts for the backup name to delete.
import os

BackupsPath = r'C:\arcgisdatastore\backup\tilecache'

IndexPath = os.path.join(BackupsPath,"index")
File = open(IndexPath,'r')

BackupName = str(input('BackupName:'))

option1 = f'"{BackupName}",'
option2 = f',"{BackupName}"'
option3 = f'"{BackupName}"'
OptionsList = [option1, option2, option3]
List = []

try:
    for line in File:
        for option in OptionsList:
            try:
                if option in line:
                    line = line.replace(option,'')
                    print('Backup name found.')
                    break
            except Exception as Ex:
                print('Backup name does not exist.')

        List.append(line)
    File.close()

    File = open(IndexPath,'w')
    for line in List:
        File.write(line)
        
    File.close()

    for files in os.listdir(BackupsPath):
        f = os.path.join(BackupsPath,BackupName)
        if os.path.isfile(f):
            os.remove(f)
            print('Deleted Backup File from Backups Folder')
            break
except Exception as Ex:
    print(Ex)

Article ID: 000027818

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options