Custom Backup Locations for Instances on Linux

This guide is an expanded version of how to add custom backup locations for your instances in AMP. It took me a while to figure this out and wanted to share with the rest of the community. The base of process comes from How to change backup locations but I will go thru everything a bit deeper here as there are some things that are left out if you are new to AMP.

There are three main things that must be done for each instance for this process to work:

  1. Modify the FileManagerPlugin for seeing the folder in file manager
  2. Modify the LocalFileBackupPlugin to pair the share with the instance
  3. Modify Docker settings (if using Docker) with new paths to ensure docker can make the appropriate connections

Thus far, I have only found out how two out of the three can be automated on new instance creation. If I figure out how to automate more, I will update this guide. From a Discord conversation, the FileManagerPlugin seems to be not high priority to get this working and is optional.

So TLDR

  • New Instance process is modify the deployment config section for mounted shares and local file pathing. File Manager manually after instance creation is optional
  • Existing Instance process is modify manually for each instance

My Setup

For my setup, I have a NAS running a VM where AMP lives. My NAS passes thru a mounted folder in /mnt/ampdata that is accessible from the VM. I will not dive deep into how to do that or how to ensure permissions are set properly as there are so many ways to do that. From here on out, I will be using /mnt/ampdata in my examples to better differentiate between the share and the word backups used in some of the key/value pairs in the config files.

New Instance Deployment LocalFileBackup Config

This process should make it so all new instances have the proper settings within their LocalBackupPlugin.kvp

  1. First go to the AMP web interface and go to Configuration -> Instance Deployment -> Deployment Defaults -> Default Settings
  2. From there add to the Default Settings the following key/value pair:
  • Key - LocalFileBackupPlugin.Storage.StorePath
  • Value - /mnt/ampdata/{{InstanceName}}/

New Instance Docker Config

  1. First go to the AMP web interface and go to Configuration -> Instance Deployment -> Deployment Defaults -> Default Mount Bindings
  2. Use /mnt/ampdata for the HostPath and Container Path

:construction: New Instance FileManager Config :construction:

  • This section is a work in progress because I have yet to find a way to automate this

Updating Existing Instance LocalFileBackup Config

  1. Stop instance you wish to update
  2. Using the webui top level File Manager, go into instance folder and open LocalFileBackupPlugin.kvp
  3. Change the location for Storage.StorePath to the new location /mnt/ampdata/{{InstanceName}}/
    1. Save and Exit file editor

Updating Existing Instance FileManager Config

  1. Stop instance you wish to update (if you haven’t done so already)
  2. Using the webui top level File Manager, go into instance folder and open FileManagerPlugin.kvp
  3. Change the FileManager.AdditionalVirtualDirectories to {"backups":"/mnt/ampdata"}
  4. Save and Exit file editor

Updating Existing Instance Docker Config

This one was the part that was super difficult for me to figure out as ADS01 (the whole AMP software) needs to be down to edit the json file properly.

  1. SSH or open the Terminal on your server
  2. Type in su -l amp to switch user to the amp user in linux. If yo do not do this step, you will not be able to edit the docker file. If you don’t remember your amp user password, you can elevate to root using sudo su and type in passwd amp to change the password to something you remember
  3. Once you are logged in as the amp user you will see your terminal prompt change to something like  CubeCoders AMP  💻amp@amp  📁~ 
  4. Run ampinstmgr -stop ADS01 to stop your amp software and instances
  5. Using a terminal based text editor edit the instances.json file by typing in nano /home/amp/.ampdata/instances.json
  6. Use Control + W and type in CustomMountBind and hit enter. This will take you to the first instance of that string in the file
  7. Between the { } add "/mnt/ampdata":"/mnt/ampdata"
  8. Use Control + W and enter to continue looking thru the file and finding additional instances to modify
  9. When done making edits, use Control + X to leave the editor. You will be asked if you want to save. Press y and then Enter
  10. Finally run ampinstmgr -start ADS01 to restart amp and your instances

I hope this was useful and if anyone figures out how to template the FileManger, I will be happy to edit!