How can I use my Version 6 sessions in Version 5? (File Encoding Conversions & Batch Conversions)

PROBLEM DESCRIPTION or QUESTION



I've exported session from Xshell 6 and have imported them into Version 5. When accessing the session files in Xshell 5, the contents of the session file are missing.


RESOLUTION


Beginning with Xshell 6, the encoding of session files was changed to Unicode in the UTF16 format. Thus, Version 6 session files imported into Version 5 cannot be read properly.
To resolve this, the session files exported from Version 6 need to first be converted to ANSI encoding before they can be read in Version 5.
NOTE: When importing an exported session file, the passwords stored in the session file will work properly only if being used in the same user environment on the same PC. If exporting from one device and importing to another, you must first encode the session files with a Master Password before exporting. The same Master Password must then be set on the device on which the session files will be imported.

Conversion Method

  1. You'll notice that the exported session files are in the .xts format which is a ZIP format. Change the extension of the file to the .zip format and unzip the file.
  2. Open the unzipped file with Notepad.
  3. From the 'File' menu, select 'Save As'. Change the 'Encoding' to 'ANSI' and save.
  4. After converting all desired session files using the method above, copy the session files to Xshell 5's session folder.


Batch encoding conversion using PowerShell

  1. You'll notice that the exported session files are in the .xts format which is a ZIP format. Change the extension of the file to the .zip format and unzip the file.
  2. Run PowerShell and navigate to the folder containing the unzipped session files.

  3. .Convert all session files in the current folder and subfolders to the ANSI format by running the following command:

    foreach($file in ls -recurse -filter "*.xsh") {
        $src = type $file.fullname
        Out-File -filepath $file.fullname -inputobject $src -encoding ascii -force
    }