.. 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 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 wapttasks * Restore the following directories. .. code-block:: bash # Debian / Ubuntu /var/www/wapt/ /var/www/wapt-host/ /var/www/waptwua/ /opt/wapt/conf/ /opt/wapt/waptserver/ssl/ # Centos / RedHat /var/www/html/wapt/ /var/www/html/wapt-host/ /var/www/html/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! .. code-block:: bash sudo -u postgres psql -c "drop database wapt" sudo -u postgres psql < /tmp/backup_wapt.sql * Apply ownership rights to the restored folders. .. code-block:: bash # Debian / Ubuntu 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/ # CentOS / RedHat chown -R wapt:www-data /var/www/html/wapt/ chown -R wapt:www-data /var/www/html/wapt-host/ chown -R wapt:www-data /var/www/html/waptwua/ chown -R wapt /opt/wapt/conf/ chown -R wapt /opt/wapt/waptserver/ssl/ * Scan package repositories. .. code-block:: bash # Debian / Ubuntu wapt-scanpackages /var/www/wapt/ # CentOS / RedHat 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 start wapttasks net start waptserver net start waptnginx * 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\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-9.6\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 server. .. code-block:: bash net start wapttasks net start waptserver net start waptnginx