Popup YouTube Video
Sheerpower Logo

Backing Up and Restoring ARS Tables


arsbackup copies tables into backup files, and arsrestore rebuilds the tables from them. A backup can be taken while programs are using the tables. The examples on this page use a folder, c:\ars_demo, holding copies of two sample tables, client and vendor, in its data folder.

Backing up a folder of tables

Name the folder that holds the tables, then the folder the backup goes into. The backup folder must already exist.

cd c:\ars_demo
arsbackup data backups "nightly" STATS
ARSBACKUP V11.028
  Preparing backup of C:\ars_demo\data\client.ars, cache size 10432512 bytes
  Preparing backup of C:\ars_demo\data\client.def
  Preparing backup of C:\ars_demo\data\client.str
  Preparing backup of C:\ars_demo\data\vendor.ars, cache size 10432512 bytes
  Preparing backup of C:\ars_demo\data\vendor.def
  Preparing backup of C:\ars_demo\data\vendor.str

--Backup started 08-Nov-2026 04:13:12 -- Number of files: 6
  Successful backup of C:\ars_demo\data\client.ars
                    to C:\ars_demo\backups\client.ARS_BACKUP
Stats for C:\ars_demo\data\client.ars
  Bkts backed up:              1  Bkts already done:           0
  Bkts in order:               1  Bkts out of order:           0
  Successful backup of C:\ars_demo\data\client.str
                    to C:\ars_demo\backups\client.str
  Successful backup of C:\ars_demo\data\client.def
                    to C:\ars_demo\backups\client.def
  Successful backup of C:\ars_demo\data\vendor.str
                    to C:\ars_demo\backups\vendor.str
  Successful backup of C:\ars_demo\data\vendor.ars
                    to C:\ars_demo\backups\vendor.ARS_BACKUP
Stats for C:\ars_demo\data\vendor.ars
  Bkts backed up:             10  Bkts already done:           0
  Bkts in order:              10  Bkts out of order:           0
  Successful backup of C:\ars_demo\data\vendor.def
                    to C:\ars_demo\backups\vendor.def

  Files with errors: 0

--Backup completed 08-Nov-2026 04:13:12
  • Each table becomes one .ARS_BACKUP file, much smaller than the table. Here client.ars (559,616 bytes) became a 3,072-byte backup, and vendor.ars (527,872 bytes) one of 241,664 bytes.
  • The folder's other files are copied as they are, so each table's .str and .def files are in the backup too.
  • The tables are backed up at the same time, so the order of the lines can differ from one run to the next.
  • After the two folders come two optional words. The first is a description, kept inside the backup files; the second is STATS, for the bucket counts shown above. To get the counts, give a description first: a third word is always taken as the description.

Backing up while programs run

Programs can keep reading and changing the tables while arsbackup runs, and each backup is a complete, consistent copy of its table. A program that writes to a table during its backup runs more slowly until the backup ends, so schedule backups for a quiet time of day: in Windows Task Scheduler, or with cron on Linux.

Choosing the tables

  • Name tables in a comma list (no spaces): arsbackup data\client,data\vendor backups. Only the tables are copied then, not their .str and .def files.
  • A wildcard picks tables: arsbackup data\v* backups backs up every table whose name starts with v.
  • A list file can hold the lines for a regular backup. Each line is the tables, then the folder for their backup:
    data\client,data\vendor backups_from_list
    
    arsbackup -include backup_list.txt
    

Restoring

arsrestore takes the backup files and the folder to rebuild the tables in. It adds every record again and builds the keys new, and it copies the other files back as they are.

arsrestore backups restored
ARSRESTORE V11.028
  Preparing restore of C:\ars_demo\backups\client.ars_backup
  Preparing restore of C:\ars_demo\backups\client.def
  Preparing restore of C:\ars_demo\backups\client.str
  Preparing restore of C:\ars_demo\backups\vendor.ars_backup
  Preparing restore of C:\ars_demo\backups\vendor.def
  Preparing restore of C:\ars_demo\backups\vendor.str

--Restore started 08-Nov-2026 04:13:12 -- Number of files: 6
  Restored C:\ars_demo\backups\client.str
       to: C:\ars_demo\restored\client.str
  Restored C:\ars_demo\backups\client.def
       to: C:\ars_demo\restored\client.def
  Restored C:\ars_demo\backups\vendor.str
       to: C:\ars_demo\restored\vendor.str
  Restored C:\ars_demo\backups\vendor.def
       to: C:\ars_demo\restored\vendor.def
  Restored C:\ars_demo\backups\client.ars_backup
       to: C:\ars_demo\restored\client.ARS
  Restored C:\ars_demo\backups\vendor.ars_backup
       to: C:\ars_demo\restored\vendor.ARS

Files SUCCESSFUL:  6

Files with ERRORS and DELETED: 0

--Restore completed 08-Nov-2026 04:13:12

Then check the restored tables. arschk with -count counts the records quickly:

arschk restored\vendor -count
...
Records: 1383
ARSCHK finished:  SUCCESSFUL Validation of restored\vendor.ars

The next page, Checking and Repairing ARS Tables, explains arschk's report.

Restore into an empty folder:

arsrestore replaces a table of the same name in the folder without asking. Restore into an empty folder, check the tables there, and copy them into place at a time when no program is using them.

  • One table: arsrestore backups\client restored (the .ARS_BACKUP is assumed).
  • -stats adds the restore's speed and cache figures; -continue keeps adding records after one that fails. Typed alone, arsrestore lists the rest of its options, most of them for speed.
  • Between Windows and Linux: a backup made on Windows restores on Linux, and one made on Linux restores on Windows. On Linux, give the backup files lower-case names.

Takeaways

  • arsbackup data backups backs up every table in a folder, plus its other files, into an existing backup folder.
  • Programs can keep working during a backup; writes to a table slow down until its backup ends.
  • arsrestore backups restored rebuilds the tables, keys and all.
  • Restore into an empty folder and check the tables with arschk before putting them in place.

Hide Description

    

       


      

Enter or modify the code below, and then click on RUN

Looking for the full power of Sheerpower?
Check out the Sheerpower website. Free to download. Free to use.