This node app backup your Portainer objects and Docker services.
Current portainer API supported is 1.24.2
docker run --name pbk \
-v /etc/localtime:/etc/localtime \
-v /volumes/data/config.json:/data/default.json \
-v /volumes/data/backup/:/data/backup/ \
-v /var/run/docker.sock:/var/run/docker.sock \
-d lucasdiedrich/portainer-backup
This command will create (or replace) a file named <objects>.json
where all objects with Total
control from portainer will be saved.
A backup file is mandatory to restore objects, but it can be created by hand if you follow the backup format.
$ node . backup
The backup file are tar gzipped inside another .tgz.
The will one file for each portainer object available and onde aditional file for Docker services model.
Stack example file:
[
{
"Name": "nginx",
"SwarmID": "jpofkc0i9uo9wtx1zesuk649w",
"StackFileContent": "version: 3\n services:\n web:\n image:nginx"
},
{
"Name": "HelloWorld",
"SwarmID": "jpofkc0i9uo9wtx1zesuk649w",
"StackFileContent": "version: 3\n services:\n hello-world:\n image:hello-world"
}
]
{
"name": "pbk-backup",
"portainer": {
"url": "https://exampleurl.com",
"login": "blablabla",
"password": "*******"
},
"consoleLogLevel": "trace",
"backupFolder": "/backup",
"disablessl": true,
"tmpFolder": "/tmp",
"socketPath": "/var/run/docker.sock"
}
This project was built on top of portainer-backup-restore