Manage Connected Storage (xbstorage.exe)

Manages connected storage on the console.

Xbstorage.exe provides the subcommands and functions described in the following table.

Command Description
resetPerforms a factory reset on Connected Storage.
importImports data from the specified XML file to a Connected Storage space.
exportExports data from a Connected Storage space to the specified XML file.
deleteDeletes data from a Connected Storage space.
generateGenerates dummy data and saves to the specified XML file.
simulateSimulates out of Storage Space conditions.

xbstorage reset

Erases all local data in Connected Storage from the local console, restoring it to factory settings. Data that has been persisted to the cloud is not modified and will be downloaded again as necessary.

xbstorage reset [/force]
Option Description
/force Confirms that Connected Storage should be reset. Running the reset command without specifying /force causes the following message to be displayed: As Connected Storage factory reset is a potentially destructive operation this command does not perform the reset unless the /force flag is present.

xbstorage import

Imports data specified in filename to a Connected Storage space.

The file is an XML file that contains the data. For an example, see xbstorage generate. For more information about the file’s XML format, see Import and export file format, later in this topic.

There are two ways to specify the Connected Storage space:

Examples of usage:

  xbstorage import mydata.xml
  xbstorage import mydata.xml /replace
  xbstorage import mydata.xml /machine /scid:2AAEB34B-DAB2-4879-B625-D970069C1D22
  xbstorage import mydata.xml /msa:user@domain.com /scid:2AAEB34B-DAB2-4879-B625-D970069C1D22
  xbstorage import mydata.xml /verbose  

Note

Before importing to the specified Connected Storage space, the system will attempt to synchronize with the cloud using the same logic that runs when a Connected Storage space is acquired by a running app.

If an application with the same Primary SCID is running, this operation could cause a race condition, and the contents of the Connected Storage Space could be in an indeterminate state.

If /replace is not specified, the containers specified in the input file will be erased before writing the blobs specified in the input file. Containers in the Connected Storage space not specified in the input file will remain untouched.

xbstorage import file-name [/scid:SCID] [/machine] [/msa:account] [/replace] [/verbose]
Option Description
file-nameSpecifies an XML file that contains the data to import.
/scid:SCIDSpecifies the Service Configuration Identifier (SCID).
/machine Specifies a per-machine Connected Storage space. This option cannot be used simultaneously with the /msa option.
/msa:account Specifies an account to use for per-user Connected Storage. The user must be signed in to the console for the space to be used. This option cannot be used simultaneously with the /machine option.
/replaceDeletes all containers in the specified Connected Storage Space before importing.
/verboseDisplays the status of the importation.

xbstorage export

Exports data from a Connected Storage space to the file specified by outfile.

The file is an XML file that contains the data. See xbstorage generate to see how to generate an example. For more information about the file’s XML format, see Import and export file format, later in this topic.

There are two ways to specify the Connected Storage space:

Examples of usage:

  xbstorage export exporteddata.xml /context:space.xml
  xbstorage export exporteddata.xml /machine /scid:2AAEB34B-DAB2-4879-B625-D970069C1D22
  xbstorage export exporteddata.xml /msa:user@domain.com /scid:2AAEB34B-DAB2-4879-B625-D970069C1D22
  xbstorage export exporteddata.xml /context:space.xml /verbose  

Note

Before exporting the specified Connected Storage space, the system will attempt to synchronize with the cloud using the same logic that runs when a Connected Storage space is acquired by a running app.

If an application with the same Primary SCID is running, this operation could cause a race condition, and the contents of the Connected Storage Space could be in an indeterminate state.

xbstorage export outfile [/context:input-file] [/scid:SCID] [/machine] [/msa:account] [/verbose]
Option Description
outfileXML file the data will be exported to.
/context:input-fileSpecifies an input file from which to read the space information.
/scid:SCIDSpecifies the service configuration identifier (SCID).
/machine Specifies a per-machine Connected Storage space. This option cannot be used simultaneously with the /msa option.
/msa:account Specifies an account to use for per-user Connected Storage. The user must be signed in to the console for the space to be used. This option cannot be used simultaneously with the /machine option.
/verboseDisplays the status of the export operation.

xbstorage delete

Deletes all data from a Connected Storage space.

There are two ways to specify the Connected Storage space:

Examples of usage:

  xbstorage delete /context:space.xml
  xbstorage delete /machine /scid:2AAEB34B-DAB2-4879-B625-D970069C1D22
  xbstorage delete /msa:user@domain.com /scid:2AAEB34B-DAB2-4879-B625-D970069C1D22
  xbstorage delete /context:space.xml /verbose  

Note

Before deleting the specified Connected Storage space, the system will attempt to synchronize with the cloud using the same logic that runs when a Connected Storage space is acquired by a running app.

If an application with the same Primary SCID is running, this operation could cause a race condition, and the contents of the Connected Storage Space could be in an indeterminate state.

xbstorage delete [/context:input-file] [/scid:SCID] [/machine] [/msa:account] [/verbose]
Option Description
/context:input-fileSpecifies an input file from which to read the space information.
/scid:SCIDSpecifies the service configuration identifier (SCID).
/machine Specifies a per-machine Connected Storage space. This option cannot be used simultaneously with the /msa option.
/msa:account Specifies an account to use for per-user Connected Storage. The user must be signed in to the console for the space to be used. This option cannot be used simultaneously with the /machine option.
/verboseDisplays the status of the delete operation.

xbstorage generate

Generates dummy data and saves to a file specified by <filename>. For more information about the file’s XML format, see Import and export file format, later in this topic.

The service configuration identifier (SCID) will be set to 00000000-0000-0000-0000-000000000000, and the account will be set for a per-machine Connected Storage space. If you want to change those values, you can edit the file directly after it is generated.

Examples of use:

  xbstorage generate dummydata.xml
  xbstorage generate dummydata.xml /containers:4
  xbstorage generate dummydata.xml /blobs:10
  xbstorage generate dummydata.xml /containers:4 /blobs:10
  xbstorage generate dummydata.xml /containers:4 /blobs:10 /blobsize:512  

Note

The byte data is a simple ascending sequence; for example, a five-byte blob would have the following bytes: 00 01 02 03 04.

If you want to specify a per-user Connected Storage space, change the Account node in the XML file to something like the following:

  
  <Account msa="user@domain.com"/>  
xbstorage generate file-name [/containers:n] [/blobs:n] [/blobsize:n]
Option Description
file-nameXML file the data will be written to.
/containers:nSpecifies the number, n, of containers to generate. The default count is 2.
/blobs:nSpecifies the number, n, of blobs to generate. The default count is 3.
/blobsize:nSpecifies the number, n, of bytes per blob. The default size is 1024 bytes.

xbstorage simulate

Simulates out of local storage conditions for the Connected Storage Service.

xbstorage simulate [/reserveremainingspace] [/forceoutoflocalstorage] [/stop] [/verbose]
Option Description
/reserveremainingspaceReserves all remaining space in Connected Storage. Deleting something from ConnectedStorage will open up space that you can use.
/forceoutoflocalstorageSimulates the Connected Storage Service having no available space left. Deleting something from Connected Storage will not change the Connected storage service from reporting out of memory.
/stopStops all simulations.
/verboseDisplays the status of the simulate operation.

Common Options

xbstorage [/?] [/X:address [+accesskey] ]
Option Description
/? Displays help for xbstorage.exe
/X:address [+accesskey] Specifies the host name or address (shown as Tools IP on the console) of a targeted console, but does not change the default console. For information about setting a host name for a console, see Setting a Hostname for the Console IP Address.If you do not use this option, the default console (previously set by Connect (xbconnect.exe)) is used.Accesskey is a string that you can use to restrict access to a console to only those people who know the access key. Set the access key by using the command xbconfig accesskey=your-key; then, restart your console to make the access key effective. To access a console that is configured with an access key, you must include a plus sign (+) and the access key after the IP address or host name of the console. For more information about access keys, see xbconfig accesskey.
Note
If an access key is provided when the default console is set by xbconnect, then the access key is stored as part of the address of the default console.

Import and export file format

The XML file used with the import, export, and generate commands has the format shown in the following example.

  <?xml version="1.0" encoding="UTF-8"?> 
  <XbConnectedStorageSpace> 
    <ContextDescription> 
      <Account machine="true" /> 
      <Title scid="00000000-0000-0000-0000-000000000000" /> 
    </ContextDescription> 
    <Data> 
      <Containers> 
        <Container name="Container1"> 
          <Blobs> 
            <Blob name="Blob1"> 
              <![CDATA[... ] ]> 
            </Blob> 
            ... 
            <Blob name="BlobN"> 
              <![CDATA[... ] ]> 
            </Blob> 
          </Blobs>
        </Container> 
        ... 
        <Container name="ContainerN"> 
        ... 
        </Container> 
      </Containers> 
    </Data> 
  </XbConnectedStorageSpace>  

Note The format of data in these XML files is not identical to what’s on the platform. The data format for these XML files could potentially change in the future, so they should be treated as an intermediate or utility format, not an archival format.

The ContextDescription node is optional. If you are making a connected storage space for a user, you can use <Account msa="user@domain.com"/> instead of <Account machine="true"/>. Otherwise, the context can be specified on the command line for importation.

Blobs and containers should have the corresponding names given to them by the game or application for which the file is being generated.

The contents of each blob should be a string wrapped in a CDATA tag, which is generated by calling CryptBinaryToStringW with the flag CRYPT_STRING_BASE64 providing the data for that blob as a raw byte array. Conversely, blob data can be converted back by calling CryptStringToBinary and providing the formerly encrypted string. An example of using these two functions is shown in CryptBinaryToString returns invalid bytes in the MSDN forums for Visual Studio.

See also

Command Line Tools

XTF Transport Errors

Connect (xbconnect.exe)

Managing Local Connected Storage