CentOS 7.x Restore papercut database from backup
From Notes_Wiki
<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:
- Assuming same version of papercut is installed as the backup machine
- 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
- Change user from root to papercut using su - papercut. Without this user change you cannot use db-tools
- 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"
- Exit from papercut user and again become root user. Without this user change you cannot start the services which require root access.
- Re-initialize current database and restore backup using
- Start stopped services using:
- systemctl stop pc-app-server
- systemctl stop pc-event-monitor
- systemctl stop pc-web-print
- 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:
- https://www.papercut.com/kb/Main/MigratingYourDatabaseServer
- https://www.papercut.com/support/resources/manuals/ng-mf/common/topics/sys-backups.html
- https://www.papercut.com/support/resources/manuals/ng-mf/common/topics/tools-db-tools.html
<yambe:breadcrumb self="Restore papercut database from backup">CentOS 7.x Print server|Print server</yambe:breadcrumb>