Updating an Acunetix Docker container
Before updating your main Acunetix Docker container, you must ensure that your setup already uses a separate data volume.
Avoid Data Loss when updating your Acunetix Docker container |
Scenario 1: You are already using a separate data volume for Acunetix data
In this scenario, you should perform the following steps:
- Make a backup of your data volume's contents as a safety precaution.
- Update the main Acunetix Docker container attaching the same data volume that was attached to the container containing the previous version.
How to backup your data volume's contents
On the docker host:
- Create a folder to store your backup and adjust permissions on the folder.
mkdir /axbak chmod 777 /axbak |
- Stop the main Acunetix container.
docker stop axmain |
- Create the backup archive.
docker cp -a axmain:/home/acunetix/.acunetix - > /axbak/acunetix-backup.tar |
How to update the main Acunetix Docker container
On the docker host:
- Update the Acunetix docker image to the latest version.
docker pull invicti/acunetix:latest |
- Stop the main Acunetix container if it is running
docker stop axmain |
- Rename the old container for safety.
docker rename axmain axmain-old |
- Run your new container using the latest Acunetix docker image and your data volume (replacing the hostname with your value).
docker run -d -p 3443:3443 -p 7880:7880 \ --name "axmain" \ --hostname 192.168.5.142 \ -v acunetix-data:/home/acunetix/.acunetix \ invicti/acunetix:latest |
Scenario 2: You are NOT using a separate data volume for Acunetix data
In this scenario, you should perform the following steps:
- Make a backup of your data.
- Restore your backup data onto a new data volume and update the main Acunetix Docker container attaching the data volume you have just created.
How to backup Acunetix data from the current Acunetix container
Perform the following steps on the Docker host:
- Create a folder to store your backup and adjust permissions on the folder.
mkdir /axbak chmod 777 /axbak |
- Stop the main Acunetix container.
docker stop axmain |
- Create the backup archive.
docker cp -a axmain:/home/acunetix/.acunetix - > /axbak/acunetix-backup.tar |
How to restore Acunetix data to a new data volume and update your main Acunetix Docker container
Perform the following steps on the Docker host:
- Create a new data volume.
docker volume create acunetix-data |
- Update the Acunetix docker image to the latest version.
docker pull invicti/acunetix:latest |
- Stop the main Acunetix container if it is running.
docker stop axmain |
- Rename the old container for safety.
docker rename axmain axmain-old |
- Create a new Acunetix container using the new data volume and the same ports as the previous container to match the settings in the backup archive (replacing the hostname with your value).
docker run -d -p 3443:3443 -p 7880:7880 \ --name "axmain" \ -v acunetix-data:/home/acunetix/.acunetix \ invicti/acunetix \ --hostname 192.168.5.142 |
- Stop the new Acunetix container.
docker stop axmain |
- Restore the archived data into the new data volume.
docker cp - axmain:/home/acunetix < /axbak/acunetix-backup.tar |
- Start the new Acunetix container.
docker start axmain |