Plesk

Mail import sessions are not shown in the Mail Importing menu: Failed to write final import status to a file

Symptoms

Cause

Site Import cannot read or write to one of the JSON files because it has improper format.

This issue is a Plesk Migrator bug with ID PMT-4988 that is planned to be fixed in future product updates.

Resolution

 

For Plesk on Linux

 

Clear the session folder

 

Note: In this case, previous import sessions will be lost for the domain.

  1. Connect to the Plesk server via SSH.

  2. Find the ID of the domain to which mail content is being migrated:

    # plesk db "select id from domains where name='example.com'"
    +----+
    | id |
    +----+
    | 89 |
    +----+

  3. Remove everything from the session folder of the domain. Use ID found on step 2:

    1. On Linux:

      # rm -f /usr/local/psa/var/modules/site-import/sessions/mail-migration-89

    2. on Windows Server

      %plesk_dir%varmodulessite-importsessionsmail-migration-89

  4. In Plesk, go to Domains > example.com > Mail Importing.

  5. Cancel previous import sessions that have their status stuck at "In progress" (if there are any).

 

(Advanced) Fix the corrupted JSON file on Linux

 

  1. Connect to the Plesk server via SSH.

  2. Find the ID of the domain to which mail content is being migrated:

    # plesk db "select id from domains where name='example.com'"
    +----+
    | id |
    +----+
    | 89 |
    +----+

  3. Go to the migration session directory of this domain. Use ID found on step 2:

    # cd /usr/local/psa/var/modules/site-import/sessions/mail-migration-89

  4. Run the following script to find corrupted JSON files inside the direcotry:

    # ls *.json | while read i; do echo $i; python -mjson.tool $i > /dev/null ; done

    On some systems, the utility python2 is used instead of python. In this case, run:

    # ls *.json | while read i; do echo $i; python2 -mjson.tool $i > /dev/null ; done

  5. Look through the output to find the corrupted JSON file:

    mail_migration_status.json
    Extra data: line 52 column 2 - line 52 column 3 (char 1748 - 1749)

  6. Use any JSON syntax parser tool (for example, JSONLint JSON Validator) to fix the corrupted JSON file.

  7. In Plesk, go to Domains > example.com > Mail Importing.

  8. Cancel previous import sessions that have their status stuck at "In progress".

 

(Advanced) Fix the corrupted JSON file on Windows Server

 

  1. Connect to the Plesk server via RDP.

  2. Start PowerShell prompt.

  3. Find the ID of the domain to which mail content…

Exit mobile version