-
Notifications
You must be signed in to change notification settings - Fork 5
migration‐tool.sh
Migration Tool allows for the almost complete migration of one instance to another. All items in all available API endpoints can be copied. If you've ever used Jamf Migrator/Jamf Replicator, this script does a similar job, but as it's integrated into the MJT suite, the standard instance selection procedure may be used. Additionally, if you are creating multiple new instances, this script can use the same cache multiple times, so there's no need for each item to be redownloaded for each instance.
There are no external requirements for using this script.
Migration Tool can be used interactively, or command line arguments can be supplied to use it in an automated way.
To use interactively, run the command without any arguments:
./migration-tool.sh
You will be presented with an initial menu, which asks you whether you want to archive any existing XML files. This is asked in case you wish to use cached downloaded content from a previous run. If you haven't run this script before, you can ignore this question (press enter or press N+enter), but if you haven't run it for a while, it's safer to archive the old content.
-----------------------
Jamf Migration Tool
-----------------------
[main] script started at Thu Sep 11 10:52:42 BST 2025
Do you wish to archive existing xml files? (Y/N) :
Next you are presented with the main options of the script.
=========
Main Menu
=========
1) Download config from template JSS
2) Upload config to destination JSS instance
3) Wipe JSS instance
q) Quit!
Choose an option (1-3 / q) :
The most common workflow for this script is to download content from a source (template) instance, and then to upload it to a new (destination) instance. To do this, run option 1 first, then option 2. Option 3 allows you to clear out an instance of all content - most useful if you maintain demo or training instances.
Select Download config from template JSS. You will be asked to select the instance list, and then select the instance from which you wish to download content.
Next, you are presented with a list of possible endpoints that will be downloaded. By default, all objects from all listed endpoints will be downloaded, but you are given the opportunity to select a single endpoint by entering it into the prompt.
Possible endpoints:
policies
restrictedsoftware
osxconfigurationprofiles
advancedcomputersearches
macapplications
computers
departments
ldapservers
buildings
departments
smtpserver
ebooks
dockitems
printers
packages
advancedcomputersearches
mobiledevicegroups
mobiledeviceapplications
mobiledeviceconfigurationprofiles
mobiledeviceextensionattributes
advancedmobiledevicesearches
userextensionattributes
usergroups
users
advancedusersearches
computergroups
computerextensionattributes
scripts
categories
If you only want to download items of one specific API endpoint, enter it here :
If you only want to download scripts, for example, type scripts and press Enter. Otherwise, just press Enter to download everything.
Next, you are asked if you want to download a more minimal selection of endpoints. For an explanation of these options, read the subsequent sections on Migration Tool Templates. Otherwise, to download everything, press Enter again:
Type I for iOS only, or L for limited download, or enter to download everything :
Sit back or make a coffee while everything downloads.
Once content has been downloaded, you can upload it to a new instance. As with the download option, the default is to upload everything, but you can select a single endpoint to copy by entering the name of the endpoint:
Possible endpoints
advancedcomputersearches
advancedmobiledevicesearches
advancedusersearches
categories
computerextensionattributes
computergroups
computerinventorycollection
dockitems
mobiledeviceconfigurationprofiles
mobiledeviceextensionattributes
mobiledevicegroups
osxconfigurationprofiles
packages
policies
restrictedsoftware
scripts
userextensionattributes
usergroups
users
If you only want to upload items of one specific API endpoint, enter it here :
Next, you are asked if you want to upload a more minimal selection of endpoints. For an explanation of these options, read the subsequent sections on Migration Tool Templates. Otherwise, to upload everything, press Enter again:
Type I for iOS only, or L for limited upload after a limited wipe :
Next, you are asked whether you wish to overwrite existing items on the destination instance. If you select N (no), any existing item of the same name as you are uploading will not be replaced, but any items not found will be created. If you select Y (yes), any existing items will be replaced.
Do you want to overwrite existing items on destination instance? (Y/N) :
Next you are asked whether you want to wipe the destination instance prior to uploading the content. This is the same as running the 3) Wipe JSS instance option at the first menu. Selecting this option ensures any unwanted content is removed prior to uploading the required content - most useful for a training instance.
Do you want to wipe the destination instance prior to uploading? (Y/N) :
Finally, sit back or grab a coffee while everything uploads.
This option deletes content on an instance, which can help get it ready for a new use. As with the other options, you can choose to select a specific API endpoint to delete, or just press Enter to delete everything.
The endpoints that are affected by running Migration Tool are determined using templates. These are text files in the migration-tool-templates folder of the multitenent-jamf-tools repo. You may edit these files to add or remove endpoints. The files used are as follows:
-
read_all.txt- This is the standard list used when running1) Download config from template JSS. -
read_limited.txt- This is the "limited" list used if selecting theL for limited downloadoption when downloading. -
wipe_all.txt- This is the standard list used when running3) Wipe JSS instanceand if selectingwipe the destination instance prior to uploadingprior to uploading to a destination instance. -
write_all.txt- This is the standard list used when running2) Upload config to destination JSS instance. -
write_ios.txt- This is a limited list used if creating an iOS-only instance, so all computers-related content is omitted. It is used when selecting theI for iOS onlyoption. -
write_limited.txt- This is the "limited" list used if selecting theL for limited uploadoption when uploading.
The computergroups and mobiledevicegroups endpoints are handled specially when uploading or deleting them. These items may have nested dependencies - a smart group may contain another smart group as a criterion. If you try to copy a smart group when the nested group has not yet been copied, it will fail due to the conflict. Similarly, if you try to delete a smart group when another group still depends on it, it will also fail. These conflict are detected, and so long as one conflict is recorded, another pass is done, until all conflicts have been resolved (with a set limit of 5 passes). Therefore, unlike earlier versions of this script, it is not necessary to have repeated entries for computergroups and mobiledevicegroups in the lists.