migration_add

The migration_add job creates a bulk migration job that copies email from multiple remote accounts to multiple local accounts.

Syntax

{
		<credentials object>, 
    "job": <job id>, 
    "users":
			[
						{
								"local": <local email address user migrates to>, 
                "remote": <remote email address user migrates from)>, 
                "server": <remote server:remote port>,
								"method": imap4 | imap4s | pop3 | pop3s,
								"skip": [a list of folders on the remote server], 
                "translate": {
										<remote server folder: local server folder>
										...}, 
            },
						... 
			]
}

Request fields for migration_add

The following fields can be used in the migration_add method:

Field nameObligationDefinition/Value
jobOptionalA job ID. This ID can be used in other migration requests. If an ID is not supplied in the request, it will be created and returned in the response.
usersRequiredDefines the source and destination of the email that you want to migrate. Allowed values are:

local — Specifies the email account to which mail will be copied;; must be an existing account

method — Specifies the protocol that will be used to transfer email: imap4 or pop3, with or without SSL. Allowed values are imap4, imap4s, pop3, pop3s.

Note: For pop3 migrations, only email in the remote address' INBOX will be transferred (for imap4 migrations, mail in all remote folders will be copied to local folders with the same name.

remote — Specifies the email account from which mail will be copied.

server — Specifies the remote email server address including the port, in the format address:port.

skip — A list of folder names on the remote server to ignore. Sub folders should be separated with the IMAP server's path delimiter.
Note: This value is optional and is valid for imap migrations only.

translate — A hash giving a mapping of remote folder names to local folder names. Messages on the remote server, in the remote folders will be copied to the local account to folders with the local name. Sub folders should be separated with the IMAP server's path delimiter. For local folders, the path separator is the dot character. For example, to specify the folder /Sales/2009/June use ".Sales.2009.June"

Note: This value is optional, and is valid for imap migrations only.

Response fields for migration_add

The following fields may be returned when the migration_add method is submitted:

Field nameObligationDescription/Value
errorReturned if success = falseA text string that explains the error.
error_numberReturned if success = falseA number that represents the error.
jobReturned if success = trueA job ID. This ID can be used in other migration requests.
successAlways returnedIndicates whether the request was successful or not. Allowed values are true and false.

Examples for migration_add

Creates a job to migrate account [email protected] to local account [email protected], skipping the folders Trash and Spam, and moving messages from the remote folder Sent to the local folder Sent Items.

Request

{
  "credentials": {
		"user": "[email protected]",
    "password": "sw0rdf1sh"
  },
	"users": [ {
		"local": "[email protected]", 
    "remote": "[email protected]", 
    "password": "abc123",
		"server": "mail.bigmail.com:993", 
    "method": "imap4s",
    "skip": [
      "Trash",
			"Spam" 
      ],
      "translate": {
        "Sent": "Sent Items"
			} 
		}
	] 
}

Response

{
  "success": true
  "job": "1326229437638"
}