Jump to content

Best way to copy all docker settings and configurations?


Recommended Posts

Hi,

 

Due to unraids awesomeness and how easy it is to setup dockers i've started to migrate more and more of my own things into docker containers. This is fun and all but risky, if unraid would crash it would be a pure hell to reconfigure everything and i want to save myself the trouble.

 

How can i make sure to backup everything when it comes to the docker configuration and setup? I have already made a cronjob that automatically backs up everything in /mnt/cache/appdata/* but i dont think this is all the configuration. Each docker file inside unraid also has a template config, mapping of folders, paths, ip addresses etc.

 

What more do i need to save to make sure if unraid would crash i wont have a month of headache trying to figure out my old setup again? Thanks!

Link to comment
6 minutes ago, je82 said:

How can i make sure to backup everything when it comes to the docker configuration and setup?

There is a plugin called Backup/Restore Appdata.  I am guessing that would do the trick. 😁

 

Also, if something happens to mess up your docker.img, you can remove it, create another one and from the Previous Apps section in the App tab, reinstall all the docker containers you select.  This will reinstall them with the previous configuration settings as you did them.

Link to comment
15 minutes ago, Hoopster said:

There is a plugin called Backup/Restore Appdata.  I am guessing that would do the trick. 😁

 

Also, if something happens to mess up your docker.img, you can remove it, create another one and from the Previous Apps section in the App tab, reinstall all the docker containers you select.  This will reinstall them with the previous configuration settings as you did them.

Thanks, ill check out the plugin!

Link to comment

The plugin seems to be mostly focused on backuping the appdata folder which is something i am confident i am already doing.

Can someone give me an idea how the configuration files for the docker containers in unraid are stored? For me the configuration of paths, ip addresses, names is a lot of work to do as well considering the amount of dockers i am starting to use i want these templates stored somewhere.

 

I do not feel confident in relying on "Previous Apps" in the Apps tab as it already now doesn't even show half of the dockers i have installed so that wouldn't work for me.

 

Could someone please tell me how unraid stores its docker container configurations? And how i can focus on only backing these up, i already have the appdata folder under control.

Link to comment
1 minute ago, je82 said:

I do not feel confident in relying on "Previous Apps" in the Apps tab as it already now doesn't even show half of the dockers i have installed so that wouldn't work for me.

 

Could someone please tell me how unraid stores its docker container configurations? And how i can focus on only backing these up, i already have the appdata folder under control.

All containers installed via the Apps tab should show there.   Only ones installed via a different mechanism should be absent.

 

for every container installed via the Apps tab the settings are stored as a XML template on the flash drive under the community Applications plugin folder.  You should always have a backup of your flash drive, with particular emphasis on the config folder as that includes all settings used in Unraid.

 

Link to comment
5 minutes ago, itimpi said:

All containers installed via the Apps tab should show there.   Only ones installed via a different mechanism should be absent.

 

for every container installed via the Apps tab the settings are stored as a XML template on the flash drive under the community Applications plugin folder.  You should always have a backup of your flash drive, with particular emphasis on the config folder as that includes all settings used in Unraid.

 

 

Thanks, from what i can tell its only the plugin configurations that are stored there. I have manually added a lot of docker containers that did not have pre-made templates, maybe that is why they are not showing up in the Previous Apps? I would want a way to save these configurations too.

Link to comment

Any container added via Docker -> Add Container has the configuration saved (/config/plugins/dockerMan/templates-user) 

 

If you've manually added the container (docker run or docker pull) then you need to make note of what you've done.

 

If the container is already installed, then it will not show up in Previous Apps.  If it isn't installed and you installed it via Add Container instead of bypassing the system and using the command line to install then PM me directly -> stuff like this is #1 priority for Apps (actually, any user reported bug means to me to drop everything that you're doing, tell the wife that the anniversary / birthday / valentine's day etc has to wait as there's a problem which has to be handled asap and just deal with it :) )

  • Thanks 2
Link to comment
1 minute ago, Squid said:

Any container added via Docker -> Add Container has the configuration saved (/config/plugins/dockerMan/templates-user) 

 

If you've manually added the container (docker run or docker pull) then you need to make note of what you've done.

 

If the container is already installed, then it will not show up in Previous Apps.  If it isn't installed and you installed it via Add Container instead of bypassing the system and using the command line to install then PM me directly -> stuff like this is #1 priority for Apps (actually, any user reported bug means to me to drop everything that you're doing, tell the wife that the anniversary / birthday / valentine's day etc has to wait as there's a problem which has to be handled asap and just deal with it :) )

 

Thank you!

Link to comment
  • 1 year later...
On 6/19/2022 at 8:41 PM, Hoopster said:

There is a plugin called Backup/Restore Appdata.  I am guessing that would do the trick. 😁

 

Also, if something happens to mess up your docker.img, you can remove it, create another one and from the Previous Apps section in the App tab, reinstall all the docker containers you select.  This will reinstall them with the previous configuration settings as you did them.

Well that only backups the data. If the image is corrupted or removed, that wont directly help.

Backing up the docker.img file should be possible I recon, and restoring all known (dozens) of docker configs should be possible also. Likewise removing old unused configs should be possible. There is lots of opportunity (low hanging fruit) for easy quality of life improvements to Unraid Docker support. They already did so many things so right.

Link to comment
Just now, Barry Staes said:

restoring all known (dozens) of docker configs should be possible also.

This is already possible via Apps->Previous Apps which is why backing up the docker.img file is not worth doing as you can simply reinstate the contents of the docker.img file.

Link to comment
Posted (edited)

So I accidentally removed my docker-xfs.img file, and now I'm surprised that of all things backed up, this is not included by any of the plugins that I use to backup docker. This is the easy one i'd guess. Or did I miss how / what plugin does this?

Edited by Barry Staes
Link to comment
Posted (edited)

Regarding restoring the dockers one-by-one by finding their config in the dropdown: In my case that dropdown is hundreds of items long. I used many dockers, replaced them by others with a similar name. Many old ones in there.

To be even be capable of "recreating dockers" i had manually this way, I first had to do research in what dockers did I use currently.
For this I used this command:

root@bTower:/boot/config/plugins/dockerMan/templates-user# ls -trloah

It shows the modified date per XML file, and sorts it. The backed up XML copies also lose this metadata, so that huge list was not helping me.

Edited by Barry Staes
Link to comment
Posted (edited)

Probably this new feature akin to "Add Container" could alleviate the problem for people like me:
 

On Docker page, at bottom a new button "Recreate Containers"
Shows a page that lists all existing XML configs (`/boot/config/plugins/dockerMan/templates-user/*.xml`) in a table:  

 

| [checkbox for selection] | XML name original | User provided name | XML Last modified date | XML Created date | Docker exists now Yes/No |


With a button "Select all dockers that do not exist now" and a button "Recreate all selected Containers".
And an explanation that this loads the files from that folder, and that "Add Container" allows doing the same.

 

This does not exist yet. I hope it gets added. I have had this problem many many times already, just to many containers to manually recreate. And just to many old ones spoiling my the list.

Edited by Barry Staes
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...