Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Quickstart Official documentation Setuphelpers Changelog FAQ
Back to top
View this page
Toggle table of contents sidebar

# 4. Backing up the WAPT Server

To backup your WAPT Server follow this procedure. Regular backups are recommended.

Before starting the migration of the WAPT server, it is highly recommended to perform a thorough cleanup of the repository. This will facilitate the migration by reducing the amount of data to be transferred, speeding up the process, and minimizing the risks of corruption or errors.

Cleanup Steps of packages in the waptconsole:

> 1- Package Identification:

> Review all packages present in the repository. Identify packages that have multiple versions, such as Firefox and others.

> Hint

> In the WAPT Package tab you can select all packages, and do a right-click Select obsolete packages. Use with caution and at your own risk.

> 2- Keeping Current Versions:

> For each package with multiple versions, keep only the version currently in production. Remove old versions and unused versions.

> 3- Comprehensive Verification:

> Ensure this operation is performed for all packages in the repository. Verify that the retained versions are indeed those used in production.

## 4.1. Linux

- Stop WAPT related services on the WAPT Server.

    systemctl stop wapttasks
    systemctl stop waptserver-uwsgi (if used)
    systemctl stop waptserver
    systemctl stop nginx

- Backup recursively these directories using a backup tool (ex: rsync, WInSCP, etc..).

    /var/www/wapt/
    /var/www/wapt-host/
    /var/www/waptwua/
    /var/www/wads/
    /opt/wapt/conf/
    /opt/wapt/waptserver/ssl/
    /var/www/*.json

    /var/www/html/wapt/
    /var/www/html/wapt-host/
    /var/www/html/waptwua/
    /var/www/html/wads/
    /opt/wapt/conf/
    /opt/wapt/waptserver/ssl/
    /var/www/html/*.json

Hint

If you use Kerberos to authenticate hosts and users, save the `keytab` file too. The `keytab` file is located in the `nginx` folder.

- Backup the PostgreSQL database using the pg_dumpall utility (adapt filename with your requirements).

    sudo -u postgres pg_dumpall > /tmp/backup_wapt.sql

- Restart WAPT related services on the WAPT Server.

    systemctl start wapttasks
    systemctl start waptserver
    systemctl start nginx

## 4.2. Windows

- Stop WAPT related services on the WAPT Server.

    net stop WAPTServer
    net stop WAPTService
    net stop WAPTTftpServer

- Backup the WAPT repository folder on a remote backup destination.

    C:\wapt\conf
    C:\wapt\waptserver\repository\wapt
    C:\wapt\waptserver\repository\wapt-host
    C:\wapt\waptserver\repository\waptwua
    C:\wapt\waptserver\repository\wads
    C:\wapt\waptserver\nginx\ssl

- Backup PostgreSQL Database with pg_dump.exe.

    "C:\wapt\waptserver\pgsql-14\bin\pg_dumpall.exe" -U postgres -f C:\backup_wapt.sql

- Restart WAPT related services on the WAPT Server.

    net start WAPTPostgresql
    net start WAPTServer
    net start WAPTService
    net start WAPTTftpServer