In this guide we cover:
In this guide we'll use [dradispro.old] to refer to the IP address of your existing Dradis VM and [host] to refer to the hostname of your new Docker host.
First of all, you will need to prepare your new host for deployment.
dradis-pro-5.xx.0-assess.tar.gz.deployer, and load it:
scp dradis-pro-5.xx.0-assess.tar.gz deployer@[host]:. ssh deployer@[host] docker image load < dradis-pro-5.xx.0-assess.tar.gz
Important: Do not load or start the containers yet. You need to place the database dump in the correct folder before the containers are created so that your data is imported on first run.
Export your database from the existing VM:
$ ssh dradispro@[dradispro.old] -- 'dp-export-mysql' > dradis-mysql-backup.sql
Open dradis-mysql-backup.sql in a text editor, add the following two lines at the very top of the file, and save:
CREATE DATABASE IF NOT EXISTS dradis_production; USE dradis_production;
Copy the file into the init/ directory on your new Docker host:
$ scp dradis-mysql-backup.sql deployer@[host]:init/
Your data will be imported automatically into the database container on first startup.
Connect to your new host as deployer:
$ ssh -p 22121 deployer@[host]
Start the stack in the background:
$ docker compose up -d
You'll need to migrate your configuration values from the VM to the new container environment.
Copy the migration script into the app container:
$ docker cp migrate_configuration.rb app:/dradispro
Run the migration script:
$ docker exec -i app bundle exec rails runner migrate_configuration.rb
Copy the dp-import script into the app container:
$ docker cp pro/dp-import app:/dradispro
Run each of the following import commands in turn:
$ ssh dradispro@[dradispro.old] 'dp-export-storage' |\
docker exec -i app /dradispro/dp-import "storage"
$ ssh dradispro@[dradispro.old] 'dp-export-templates' |\
docker exec -i app /dradispro/dp-import "templates"
$ ssh dradispro@[dradispro.old] 'dp-export-attachments' |\
docker exec -i app /dradispro/dp-import "attachments"
If you had Gateway installed on your VM, also run:
$ ssh dradispro@[dradispro.old] 'dp-export-themes' |\
docker exec -i app /dradispro/dp-import "themes"
If any users on your instance has custom avatars, also run:
ssh dradispro@[dradispro.old] 'tar -cf - -C /opt/dradispro/dradispro/shared avatars' |\
docker exec -i app tar -xpf - -C /dradispro/storage/public
The backup operation is conceptually the same as the export operation described earlier, the only difference is that instead of piping the export scripts to the import scripts in the new instance we just archive the results.
Run these commands from your local machine:
$ ssh deployer@[dradispro] -- 'docker exec app dp-export-attachments' > dradis-attachments.tar $ ssh deployer@[dradispro] -- 'docker exec app dp-export-mysql' | gzip > dradis-mysql-backup.sql.gz $ ssh deployer@[dradispro] -- 'docker exec app dp-export-templates' > dradis-templates.tar
You can script this and combine it with your standard backup software to make sure all your Dradis data is safe.
In addition, you should consider the additional step of encrypting your backups for good measure (something simple like openssl should do the trick):
$ openssl enc -aes-256-cbc -salt -in file.plain -out file.enc
Great job, you reached the end of the guide! Have you read all of them?
Your email is kept private. We don't do the spam thing.