SpotLog - Import and Export


Exporting and Importing data definitions

You can export a class definition to an external file and then reimport into the application.  Thus if someone has gone to the trouble to enter all the data for the class 66 (for example) they could then share that definition with other users.  Users are encouraged to share definition data ;-)

You can export definition data at the level of Class or Railway.  If you export a class, only that class data is included in the file, if you export at the railway level, all data for that railway and all its classes is exported to a single file.

Export is in XML format:


<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<Definition>
  <Company Code="UK Mainline railways" Name="UK "> 
    <Class Code="66"> 
      <Loco Number="66001"/> 
      <Loco Number="66002"/> 
      <Loco Number="66003"/> 
      <Loco Number="66004"/>

etc

To export a data definition.

Select the Book tab, and navigate to the railway or class you want to export, select "Export Defs" from the  "Import and Export" submenu, choose a suitable file name and location, and the XML file will be created.

To import a data definition

You can import files in two formats 1) XML (As above)  2) Tab separated text files
To import a file, load the file onto the device, select the Book tab and click the menu button, select "import" from the "Import and Export" submenu and navigate to the import file, the data will be imported into the database and will update any existing records.

Text file format
You can import text files into the database, the text file format should be a line for each record with company code, class code, number and name separated by tabs:

Company Code<tab>Class Code<tab>Number<tab>Name

The text file provides an easy way to import bulk data from other sources, eg spreadsheet, as it is generally easier to edit the text file than the XML file. 

You can create XML import files from a photograph selection using the PhotoLogger PC app.

Background import

Please note data import takes place as a background process - you can continue to use the app while data is imported and the app will tell you when the import is complete.

Import from the web

You can also import datasets from the web.  Click "Import from web" from the "Import and Export" submenu - the app shows the list of definitions available to download: tap a definition to import the data.

You can safely import multiple definition sets, the import will be merged with your database and will not overwrite existing data.  It is also safe to re-import a data set.

We hope to add additional sets to the list available on the web - if you create a definition set for a railway, please consider letting us add it to the published set.  Please contact mark@rail3d.net if you have a definition set, or can help create or maintain a definition set.

Backup and Restore

You can export the whole SpotLog database using "Export DB" from the "Import and Export" menu.  This exports the whole database as an XML file.

You can also set the app to automatically export a backup of the database every time the app starts,  see Preferences for details.  Recommended.

Restoring a database backup

To restore a database backup - simply use the "Import File" option from the "Import and Export" menu and browse to the database backup file.

Note that importing an entire database can be a long process - imports take place in the background, so you can continue to use the app (or the device) while the import is in progress - but the device will appear slower because the app is doing a lot of work in the background to import the data.

You can restore a database backup when existing data is already in the database  - in this case the data will be merged - the restore will not overwrite existing data.


No comments:

Post a Comment