CentOS 7.x Restore papercut database from backup

From Notes_Wiki
Revision as of 07:00, 30 March 2021 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb self="Restore papercut database from backup">CentOS 7.x Print server|Print server</yambe:breadcrumb> =CentOS 7.x Restore papercut database from backup= Pape...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb self="Restore papercut database from backup">CentOS 7.x Print server|Print server</yambe:breadcrumb>

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:



<yambe:breadcrumb self="Restore papercut database from backup">CentOS 7.x Print server|Print server</yambe:breadcrumb>