CentOS 7.x Restore papercut database from backup

From Notes_Wiki

Home > CentOS > CentOS 7.x > Print server > CentOS 7.x Restore papercut database from backup

Papercut keeps a weekly backup of its database in <installdir>/server/data/backups folder. If we are taking backu of papercut via backup tools (eg rsnapshot) and we take backup of installdir (eg /home/papercut) then we can get the latest database backup at this location. This backup would be at most a ween old.

To restore the backup on a papercut server use following steps:

  1. Assuming same version of papercut is installed as the backup machine
  2. Stop all the services of papercut using:
    #List service names
    systemctl -a | grep papercut
    systemctl stop pc-app-server
    systemctl stop pc-event-monitor
    systemctl stop pc-web-print
  3. Change user from root to papercut using su - papercut. Without this user change you cannot use db-tools
    1. Re-initialize current database and restore backup using
      db-tools init-db -f
      db-tools import-db -f "C:\path\to\backup\backup-file-name.zip"
    2. Exit from papercut user and again become root user. Without this user change you cannot start the services which require root access.
  4. Start stopped services using:
    systemctl stop pc-app-server
    systemctl stop pc-event-monitor
    systemctl stop pc-web-print
  5. Login into papercut admin interface at http://<papercut-ip-or-fqdn>:9191/admin and validate restore worked as expected. This can be seen using graphs / logs which show printing done before the restoration date.


Refer:



Home > CentOS > CentOS 7.x > Print server > CentOS 7.x Restore papercut database from backup