Importing Legacy Logfile Sessions

### 1. Importing logfile sessions Studio uses metadata associated with each logfile session to replay it. Logfile sessions recorded with Studio **prior to release PR8** need to follow this import process in order to be replayed in Studio. This article demonstrates how to import an existing logfile session into Studio's logfile manager. ### 1.1. Article definitions The ECU that recorded the data is referred to as the _source system_. The ECU that replay the data is referred to as the _target system_. The _system SDF_ is always located at `PSYNC_HOME/db/psync.sdf`; this is the file opened by the SDF Configurator. The _replay SDF_ is directly associated to, and saved with the logfile session. ### 1.2 Assumptions The following assumptions are made: * the source system placed a copy of the SDF (`psync.sdf`) in the logfile session folder * the log session has been copied to the target machine and has been decompressed. ### 2. Swap the SDF The SDF for the logfile session needs to be updated to represent the replay environment. This step is required, unless the data was recorded on the same machine that you are replaying on and the SDF hasn't been modified. 1. Backup the existing system SDF ```bash $ cd /usr/local/polysync/db $ cp psync.sdf psync.sdf.orig ``` 2. Copy the SDF from the logfile session to replace the system SDF ```bash $ echo $PSYNC_HOME /usr/local/polysync $ cp ~/Downloads/ps-sample-logfiles/70802/psync.sdf /usr/local/polysync/db/ ``` ### 3. Update the SDF Update the SDF to represent the actual replay environment. The original SDF could contain either a single host or multiple hosts. To replay data for a particular node, it must be moved to the host that will be replaying the data. 1. Start the SDF Configurator with the desktop icon or the command ```bash polysync-sdf-configurator ``` 2. If the host wizard automatically opens with the SDF Configurator, follow the wizard to import an existing host configuration to this replay machine *and* update any missing paramters ![SDF Configurator host configuration wizard](https://help.polysync.io/releases/2.0.8//wp-content/uploads/2016/11/sdf-configurator-host-wizard.png) 3. [Move nodes](https://help.polysync.io/releases/2.0.8//articles/move-a-node-to-a-new-host/) (not duplicate) from the original host(s), to the a single target replay host 4. Remove any hosts that do not have nodes defined 5. Close SDF Configurator 6. Backup the existing logfile SDF ```bash $ cd ~/Downloads/ps-sample-logfiles/70802/ $ cp psync.sdf psync.sdf.orig ``` 7. Copy the SDF file you copied to the system SDF back to the original logfile session folder: ```bash $ cp /usr/local/polysync/db/psync.sdf ~/Downloads/ps-sample-logfiles/70802/ ``` 8. Restore the system SDF ```bash $ cd /usr/local/polysync/db $ cp psync.sdf.orig psync.sdf ``` ### 4. Importing to Studio The Studio logfile manager allows you to import data that contains the appropriate meta-data- the logfile session was exported using Studio -**or** has a proper SDF set up, which was completed in the previous two steps. 1. Start PolySync manager ```bash polysync-manager ``` 2. Start Studio with the desktop icon, or the command ```bash polysync-studio ``` 3. Click the icon ![Studio landing screen](https://help.polysync.io/releases/2.0.8//wp-content/uploads/2016/11/studio-import-02-with-emphasis.png) 4. Right-click within the logfile manager section, or select the icon ![Logfile manager area](https://help.polysync.io/releases/2.0.8//wp-content/uploads/2016/11/studio-import-03-with-emphasis.png) 5. Navigate to and select the extracted and decompressed logfile session folder, click the _Import_ button ![Logfile manager import window](https://help.polysync.io/releases/2.0.8//wp-content/uploads/2016/11/studio-import-04.png) 6. Allow the logfile session to fully import ![Importing In-progress](https://help.polysync.io/releases/2.0.8//wp-content/uploads/2016/11/studio-import-05.png) Studio will begin importing the files to the logfile management section. The import status is shown with a loading bar. A textual status and description of the file transfer is provided in the [Console](https://help.polysync.io/releases/2.0.8//articles/studio-console/) debug log messages. Once the session is visible within the logfile manager, it can be [selected for playback](/articles/?p=2164) by dragging the folder to the playlist.