OAR/IAR data backup and restore with OpenSim
Unlike the SQL backup the OAR backup for regions is suitable to save regions in a way so they can be replicated across other grids or with others (e.g. older) versions of OpenSim. Equivalent the IAR backup saves inventory and assets of a grid account (Avatar) to replicate the account’s contents into another grid. To protect against unexpected database incompatibilities, it makes sense to make additional OAR backups of your regions before changing an OpenSim version. It is necessary for moving a region to another grid.
IAR backups are very large and should not be done on a daily basis, normally the grid operator creates regular database backups. However, an additional IAR backup from time to time generates a higher immunity level.
Disadvantages of OAR/IAR backups
It greatly stresses the OpenSim server software, any visitors during the backup will be interfered. Each restore transmits objects to the server of the grid even though they are already saved there, which causes network load in the grid. (See, however, the command parameter --noassets
.)
Note: If you would like to share a region or inventory with another person or run a copy in the same grid, then do not copy a SQL backup! Otherwise you would duplicate UUIDs that may exist only once!
Mnemonic trick: backup => SQL, copy => OAR or IAR
OAR Backup
With tmux bring OpenSim into the foreground of your command line interface, so that entries into the OpenSim console are possible. Important: Release OpenSim to the background again with tmux, before closing the command line window, otherwise the program will be aborted!
In the OpenSim console change to the region you wish to save, then create a backup. Instead of just the file name a directory path may be entered. Without path information the backups end up in the “bin” directory.
change region PrimSculpts save oar MyBackupPrimSculpts.oar
Important optional parameters:--noassets
=> If the region is to be restored in the same grid, the asset data is already in the database of the grid operator. This option will omit the unnecessary copying of data.--home=http://mygrid.de
=> The creator name will be expanded to include the specified grid name. If the OAR is passed in other grids, this will preserve the unique names.--publish
=> To propagate the OAR to other avatars, this option removes the owner and group settings of land and objects. (The creator names are retained.)
OAR Restore
Again in the OpenSim console change to the region you wish to import the OAR copy to, followed by the restore. If the owners exist in the grid, they remain the owner, otherwise the Master Avatar of the region will be the new owner.
change region PrimSculptsCopy load oar MyBackupPrimSculpts.oar
Important optional parameter:
--merge
=> Additive to the existing region only objects will be added from the backup file. Terrain, land settings and existing objects remain.
Other parameters, for example, allow objects to be moved or rotated to the new region. This can be used to assemble a new VAR region from smaller region backups. Details are described in the OpenSim-Wiki.
IAR Backup
With tmux bring OpenSim into the foreground of your command line interface, so that entries into the OpenSim console are possible. Important: Release OpenSim to the background again with tmux, before closing the command line window, otherwise the program will be aborted!
Instead of just the file name a directory path may be entered. Without path information the backups end up in the “bin” directory. The credentials must belong to an account in the same grid.
save iar Maria Example / Password MariasItems.iar
Importing very large IAR files often fails, in that cases it is recommendable to export single directories. So the backup can be devided into several smaller parts. This method is helpful too, if you want to export only a part of your inventory. Directory here means what is shown inworld in your inventory browser, for example “Objects” or “Calling Cards/Friends”. If there are blanks in the path, quotation marks are required.
save iar Maria Example "Path in inventory" Password MariasItemParts.iar
Important optional parameters:--noassets
=> If the inventory is to be restored in the same grid, the asset data is already in the database of the grid operator. This option will omit the unnecessary copying of data.--home=http://mygrid.de
=> The creator name will be expanded to include the specified grid name. If the IAR is passed in other grids, this will preserve the unique names.--perm
=> If you propagate the IAR to other real persons, this option ensures to respect the permissions. Assets where copy or transfer is not allowed will not be included in the backup.
IAR Restore
Again in the OpenSim console import the IAR to the same inventory path or – if desired – to another path. Latter could be useful if you want to sort the new items manually into your inventory. Attention: The desired inventory path must already exist! If necessary, create the missing directories inworld before starting the import.
load iar --merge Drago Smith / Password MariasItems.iar
… or in a decent inventory path …
load iar --merge Drago Smith "Path in inventory" Password MariasItemParts.iar
Important optional parameter:
--merge
=> Instead of creating new directories with the same name, the items are imported into the existent path structure. In most cases this parameter produces the desired behaviour.
More details of Inventory Archives are described in the OpenSim-Wiki.