1. Introduction
If a Piwigo site is failing or a hardware failure occured on the webserver restoring a Piwigo backup at a server running Webmin and Virtualmin is a better option than a fresh install if your site contains thousands of photos. Of course backups must be available. A backup can be restored on the same webserver or on another server (see article Redirecting an URL from one Webmin server to another in case you are relocating Piwigo). After the backup a simple configuration change for the webserver is required to get the site up and running.
This article describes how to restore a backup and make the required webserver configuration change to get the Piwigo site operational again.
2. Requirements
Required for restoring a Piwigo backup on a new server:
- Piwigo backup from a working website and created via the Virtualmin backup tool
- A working Webmin/Virtualmin server where the backup gets restored
- phpMyAdmin installed on the server to be used to configure the Piwigo database. See Hosting multiple websites on a Raspberry Pi with Virtualmin.
3. Restoring a Piwigo backup
3.1 Restore backup
Execute the following steps to restore a backup which has been downloaded to your computer:
- It is recommended to reboot the new server before starting the restore. This might prevent a restore is hanging.
- Go to Virtualmin on the new server and select Virtualmin > Backup and Restore
- Select “Uplaod to server” and click on the paperclip to upload the backup file
- Make sure “Restore all features” is selected
- No global settings selected
- Set the restore options
- Click on the button
- After some time depending on the backup size something similar as below will be shown
- Click on Restore Now
- The restore process will run for a while and shows the status. It will indicate when the restore process has been completed.
3.2 Configure diskquota
For some reason the diskquota for a site is set to 1GB, which leads to issues for Piwigo as it cannot write any files if the amount of diskspace used is >1GB. When loading the website in the browser an error will be displayed. Depending on Piwigo’s php error settings it will display:
OR something like:
To fix this goto Virtualmin, select the correct site and change the quota’s to unlimited:
3.3 Configure the Piwigo database
Follow the steps in this section if loading the piwigo website shows the error below, else goto the next section.
- Go to File Manager and select the piwigo configuration files folder. Will be something like /home/<website folder>/public_html/local/config.
- Right mouse click on the database.inc.php file and select Edit. This will show you the database properties and credentials.
Here you can find the database name, database user and password required for the next steps. - Within Virtualmin select the correct website and then Edit Databases. Check the correct database is listed. If this is not the case it’s likely the database has not been included in the backup. See the part about associating the database in article Creating a website backup with Virtualmin.
- Select the tab Usernames and change the database username to the username listed in the database.inc.php file. Click on Save.
- Select the tab and and change the database password to the one listed in the database.inc.php file. Click on Save.
3.4 Test the site is working
- Test the website is accessible without logging in. Click on photo thumbnails in your albums to check the site is working for not logged in users.Be aware that the disk quota issue is not impacting guest users, only administrators.
- Now login als Piwigo administrator. Test again if you can click on a photo thumbnail to see the larger photo. It shoudl work now. If not it is likely a permission issues caused by restoring a Piwigo backup at another server running Virtualmin.When you’re logged in as admin, Piwigo tries to write cache/derivative files and PHP hits likely a filesystem permission or PHP config error, which results in HTTP 500. If this happens search the web how to solve this.
- Go to Piwigo’s maintenance page and execute the 8 indicated steps to have everything in a fresh state.
This concludes the steps for restoring a Piwigo backup at another server running Virtualmin.The following article(s) might also be of interest:
















0 Comments