Moving instances from one AMP Server to another (with existing instances)

OS Name/Version: Ubuntu 22.04 (however, this may work for all linux)

Product Name/Version: (2.6.0)

Description:

If you have stood up a new AMP server say in a VPS and moved it from on prem, or your server has needed a hardware refresh, I have figured out a way to “add” or move instances to a server with existing instances.

Before you move your instances, make sure the instances are at the same version. In this case I am making sure they are at 2.6.0.

  • Step 0: Make sure the new AMP server is stopped by running as the “amp” user ampinstmgr stopall
  • Step 1: Open up the new AMP Server and copy the instances.json file to your workstation. (Location: /home/amp/.ampdata/instances.json)
  • Step 2: Take a copy of this and keep as a backup until you confirm everything works.
  • Step 3: Open the old AMP Server and repeat 1-2. (Note: Make sure to name it something else!)
  • Step 4: In a text editor, make sure to open up the instances.json from the new server. Go to the bottom where you see:
"MetricsPublishingHMAC": "e10a8a74-57bb-4a1d-b988-f64b99047e63",
"DisplayImageSource": "internal:MinecraftJava",
"LastReactivationAttempt": null
  }
] 
  • Step 5: Put a comma after the last }.
  • Step 6: Open the old instances.json. Find where the AMP instance ends and copy all the instances below it. Make sure to NOT copy the ].
  • Step 7: This is the tedius part. Go through each of the instances you copied and look for the lines such as:
"FileManagerPlugin.SFTP.SFTPPortNumber": "2224",
"MinecraftModule.Minecraft.PortNumber": "25565",
"Core.Monitoring.MonitorPorts": "[{\"Protocol\":0,\"Port\":2224,\"Name\":\"SFTP Port\",\"IsDelayedOpen\":false,\"Required\":false},{\"Protocol\":2,\"Port\":25565,\"Name\":\"Game Port\",\"IsDelayedOpen\":false,\"Required\":false}]"
...
"Port": 8080,
  • Step 8: You will now need to do in and change any ports that are overlapping. When I did this, I knew I didn’t have more than 20 instances on the new server. I started the "Port": 8080 at "Port":8100 and in parallel did the same thing for SFTP and any service ports like Minecraft.
  • Step 9: On your old server find the folders where the instances you are moving are. Location: /home/amp/.ampdata/instances/
  • Step 10: As the root user in linux, SFTP to the root user of the new server. Navigate to the same folder location as Step 9 and move the whole folders to that location. Depending on how many instances you are moving, your link speed between the servers, drives, etc.; this may take a significant amount of time.
  • Step 11: Delete the contents of the instances.json on the new server. Replace with the modified json that has the added instances.
  • Step 12: Launch the new Amp instances as the “amp” user ampinstmgr startall. (If you get an error stating permission denied for opening a file, go back to the “root” user and run ampinstmgr fixperms.)
  • Step 13: Open Amp and confirm that the services started. If they haven’t you may need to Reactivate Local Instances under Configuration -> Instance Deployment -> Deployment Defaults -> License Key, paste in your license key and click Reactivate Local Instances.
  • Step 14: Ensure everything boots and you should now be in business.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.