Backing up the WAPT Server¶
Backing up the WAPT Server on Linux¶
Attention
This procedure is valid for WAPT 1.5 and above.
stop WAPT related services on the server;
systemctl stop nginx
systemctl stop waptserver
systemctl stop wapttasks
backup these directories using a backup tool (ex: rsync, WInSCP, etc..);
/var/www/wapt/
/var/www/wapt-host/
/var/www/waptwua/
/opt/wapt/conf/
/opt/wapt/waptserver/ssl/
backup the PostgreSQL database using the pg_dumpall utility (adapt filename with your requirements);
sudo -u postgres pg_dumpall > /tmp/backup_wapt_$(date +%Y%m%d).sql
restart WAPT related services on the server;
systemctl start wapttasks
systemctl start waptserver
systemctl start nginx
Restoring the WAPT Server on Linux¶
In case of a complete crash, restart a standard WAPT Server installation on a Linux server.
stop WAPT related services on the server;
systemctl stop nginx
systemctl stop waptserver
systemctl stop wapttasks
restore the following directories:
/var/www/wapt/
/var/www/wapt-host/
/var/www/waptwua/
/opt/wapt/conf/
/opt/wapt/waptserver/ssl/
restore the database (adapt the name of your file). The first command deletes the WAPT database (if it exists). Make sure that your dump file is correct before deleting!
sudo -u postgres psql -c "drop database wapt"
sudo -u postgres psql < /tmp/backup_wapt_20180301.sql
apply ownership rights to the restored folders:
chown -R wapt:www-data /var/www/wapt/
chown -R wapt:www-data /var/www/wapt-host/
chown -R wapt:www-data /var/www/waptwua/
chown -R wapt /opt/wapt/conf/
chown -R wapt /opt/wapt/waptserver/ssl/
scan package repositories;
wapt-scanpackages /var/www/wapt/
restart WAPT related services on the server;
systemctl start wapttasks
systemctl start waptserver
systemctl start nginx
Backing up the WAPT Server on Windows¶
backup the WAPT repository folder
C:\wapt\waptserver\repository
andC:\wapt\waptserver\conf
andC:\wapt\waptserver\nginx\ssl
on a remote backup destination;
Backup PostgreSQL Database with pg_dump.exe:
"C:\wapt\waptserver\pgsql-9.6\bin\pg_dumpall.exe" -U postgres -f C:\backup_wapt.sql
restart WAPT related services on the server;
Restoring the WAPT Server on Windows¶
restore the following directories
C:\wapt\waptserver\repository
andC:\wapt\waptserver\conf
andC:\wapt\waptserver\nginx\ssl
Apply the total right to the folder
C:\wapt\waptserver\repository
for the “Network Service” group
Restore PostgreSQL Database with pg_restore.exe:
"C:\wapt\waptserver\pgsql-9.6\bin\psql.exe" -f c:\backup_wapt.sql -U postgres