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:
- Modify the FileManagerPlugin for seeing the folder in file manager
- Modify the LocalFileBackupPlugin to pair the share with the instance
- 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
- First go to the AMP web interface and go to
Configuration -> Instance Deployment -> Deployment Defaults -> Default Settings
- From there add to the Default Settings the following key/value pair:
- Key -
LocalFileBackupPlugin.Storage.StorePath
- Value -
/mnt/ampdata/{{InstanceName}}/
New Instance Docker Config
- First go to the AMP web interface and go to
Configuration -> Instance Deployment -> Deployment Defaults -> Default Mount Bindings
- Use
/mnt/ampdata
for the HostPath and Container Path
New Instance FileManager Config
- This section is a work in progress because I have yet to find a way to automate this
Updating Existing Instance LocalFileBackup Config
- Stop instance you wish to update
- Using the webui top level File Manager, go into instance folder and open
LocalFileBackupPlugin.kvp
- Change the location for
Storage.StorePath
to the new location/mnt/ampdata/{{InstanceName}}/
-
- Save and Exit file editor
Updating Existing Instance FileManager Config
- Stop instance you wish to update (if you haven’t done so already)
- Using the webui top level File Manager, go into instance folder and open
FileManagerPlugin.kvp
- Change the
FileManager.AdditionalVirtualDirectories
to{"backups":"/mnt/ampdata"}
- 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.
- SSH or open the Terminal on your server
- 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 usingsudo su
and type inpasswd amp
to change the password to something you remember - Once you are logged in as the amp user you will see your terminal prompt change to something like
CubeCoders AMP 💻amp@amp 📁~
- Run
ampinstmgr -stop ADS01
to stop your amp software and instances - Using a terminal based text editor edit the
instances.json
file by typing innano /home/amp/.ampdata/instances.json
- Use
Control + W
and type inCustomMountBind
and hit enter. This will take you to the first instance of that string in the file - Between the
{ }
add"/mnt/ampdata":"/mnt/ampdata"
- Use
Control + W
and enter to continue looking thru the file and finding additional instances to modify - When done making edits, use
Control + X
to leave the editor. You will be asked if you want to save. Pressy
and thenEnter
- 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!