.. Reminder for header structure: Parts (H1) : #################### with overline Chapters (H2) : ******************** with overline Sections (H3) : ==================== Subsections (H4) : -------------------- Subsubsections (H5) : ^^^^^^^^^^^^^^^^^^^^ Paragraphs (H6) : """""""""""""""""""" .. meta:: :description: Restoring the WAPT Server :keywords: restore, server, WAPT, PostgreSQL, pg_dumpall, FastCopy, WinSCP, documentation .. _restore_server: ######################### Restoring the WAPT Server ######################### In case of a complete crash, restart a standard WAPT Server installation on your WAPT Server. Then follow this procedure to restore your data. .. _linux_restore_server: ***** Linux ***** * Stop WAPT related services on the WAPT Server. .. code-block:: bash systemctl stop nginx systemctl stop waptserver systemctl stop waptserver-uwsgi systemctl stop wapttasks * Restore the following directories. .. tabs:: .. code-tab:: bash Debian and derivatives /var/www/wapt/ /var/www/wapt-host/ /var/www/waptwua/ /var/www/wads/ /opt/wapt/conf/ /opt/wapt/waptserver/ssl/ .. code-tab:: bash RedHat and derivatives /var/www/html/wapt/ /var/www/html/wapt-host/ /var/www/html/waptwua/ /var/www/html/wads/ /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! .. warning:: Check the encoding before creating the wapt database, if the dumped file is in en_US, your new base has to be en_US. .. code-block:: bash sudo -u postgres psql -c "drop database wapt" sudo -u postgres psql -c "create database wapt" sudo -u postgres psql < /tmp/backup_wapt.sql * Apply ownership rights to the restored folders. .. tabs:: .. code-tab:: bash Debian and derivatives 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:www-data /var/www/wads/ chown -R wapt /opt/wapt/conf/ chown -R wapt /opt/wapt/waptserver/ssl/ .. code-tab:: bash RedHat and derivatives chown -R wapt:nginx /var/www/html/wapt/ chown -R wapt:nginx /var/www/html/wapt-host/ chown -R wapt:nginx /var/www/html/waptwua/ chown -R wapt:nginx /var/www/html/wads/ chown -R wapt /opt/wapt/conf/ chown -R wapt /opt/wapt/waptserver/ssl/ * Run a Scanpackages on your repositories. .. tabs:: .. code-tab:: bash Debian and derivatives wapt-scanpackages /var/www/wapt/ .. code-tab:: bash RedHat and derivatives wapt-scanpackages /var/www/html/wapt/ * Restart WAPT related services on the WAPT Server. .. code-block:: bash systemctl start wapttasks systemctl start waptserver systemctl start nginx .. _windows_restore_server: ******* Windows ******* * Stop WAPT related services on the WAPT Server. .. code-block:: bash net stop WAPTPostgresql net stop WAPTServer net stop WAPTService net stop WAPTTftpServer * Restore the following directories. .. code-block:: bash C:\wapt\waptserver\repository\wapt C:\wapt\waptserver\repository\wapt-host C:\wapt\waptserver\repository\waptwua C:\wapt\waptserver\repository\wads C:\wapt\waptserver\conf C:\wapt\waptserver\nginx\ssl * Apply full rights to the folder :file:`C:\\wapt\\waptserver\\repository` for the "Network Service" group. * Restore PostgreSQL Database with :program:`pg_restore.exe`. .. code-block:: bash "C:\wapt\waptserver\pgsql-14\bin\psql.exe" -f c:\backup_wapt.sql -U postgres * Scan package repositories. .. code-block:: bash wapt-scanpackages "C:\wapt\waptserver\repository\wapt" * Restart WAPT related services on the WAPT Server. .. code-block:: bash net start WAPTPostgresql net start WAPTServer net start WAPTService net start WAPTTftpServer