User Tools

Site Tools


servers:linux:nginx:piwigo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
servers:linux:nginx:piwigo [2025/08/27 19:37] Sean Rhoneservers:linux:nginx:piwigo [2025/08/27 20:15] (current) Sean Rhone
Line 14: Line 14:
  
   * [[linux:distros:server:opensuse_tumbleweed_server|openSUSE Tumbleweed (Server)]]   * [[linux:distros:server:opensuse_tumbleweed_server|openSUSE Tumbleweed (Server)]]
-  * [[servers:linux:mariadb|MariaDB]] 
   * [[servers:linux:nginx_php_php-fpm|nginx + PHP + PHP-FPM]]   * [[servers:linux:nginx_php_php-fpm|nginx + PHP + PHP-FPM]]
   * [[servers;linux;nginx;lets_encrypt|Certbot (Let's Encrypt)]]   * [[servers;linux;nginx;lets_encrypt|Certbot (Let's Encrypt)]]
 +  * [[servers:linux:mariadb|MariaDB]]
  
 ====== Dependencies ====== ====== Dependencies ======
Line 346: Line 346:
 WantedBy=timers.target</code> WantedBy=timers.target</code>
  
-====== Backup ====== +====== Old Restore ======
- +
-  * Create backup archive on server and transfer to client computer +
- +
-===== Server ===== +
- +
-==== Stop Services ==== +
- +
-**** +
- +
-  sudo systemctl stop nginx php-fpm +
- +
-==== Backup Folder ==== +
- +
-**** +
- +
-  cd '/var/www' && sudo tar -cvzf ~/'piwigo-files-manual-'$(date +%Y-%m-%d)'.tar.gz' 'media' && cd ~ && sync +
- +
-==== Backup Database ==== +
- +
-**** +
- +
-  sudo mariadb-dump --defaults-extra-file='/var/lib/mysql/auth/piwigo' --single-transaction 'piwigo' -r ~/'piwigo-database-manual-'$(date +%Y-%m-%d)'.sql' && sync +
- +
-==== Start Services ==== +
- +
-**** +
- +
-  sudo systemctl start nginx php-fpm +
- +
-===== Client ===== +
- +
-==== Transfer Files To Client ==== +
- +
-**** +
- +
-  scp espionage724@192.168.1.152:~/'piwigo-files-'*'.tar.gz' espionage724@192.168.1.152:~/'piwigo-database-'*'.sql' ~/'Downloads' && sync +
- +
-====== Restore ======+
  
 ===== Client ===== ===== Client =====
Line 394: Line 356:
   gunzip ~/'Downloads/piwigo-database-'*'.sql.gz'   gunzip ~/'Downloads/piwigo-database-'*'.sql.gz'
  
-==== Transfer Files To Server ====+====== Files ======
  
-**** +===== Backup =====
- +
-  scp ~/'Downloads/piwigo-files-'*'.tar.gz' ~/'Downloads/piwigo'*'.sql' espionage724@192.168.1.152:+
- +
-==== Remove Files ====+
  
 **** ****
  
-  rm -~/'Downloads/piwigo-files-'*'.tar.gz' ~/'Downloads/piwigo-database-'*'.sql&& sync+  sudo tar -czf ~/'piwigo-files-manual-'$(date +%Y-%m-%d)'.tar.gz' -C '/srv/www' 'media'
  
-===== Server =====+===== scp =====
  
-==== Stop Services ====+==== To Client Backup ====
  
-****+  Server back-up -> Client 
 +  Run on server
  
-  sudo systemctl stop nginx php-fpm+  scp espionage724@192.168.1.152:~/'piwigo-files-'*'.tar.gz' ~/'Downloads'
  
-==== Remove Previous Folder ====+==== To Server Restore ====
  
-****+  Client -> (files) -> Server 
 +  Run on client
  
-  sudo rm -Rf '/var/www/media'+  scp ~/'Downloads/piwigo-files-'*'.tar.gzespionage724@192.168.1.152:~
  
-==== Restore Piwigo Folder ====+===== Restore =====
  
 **** ****
  
-  sudo tar -xvzf ~/'piwigo-files-'*'.tar.gz' -C '/srv/www' 'media' && sudo chown -R 'wwwrun' '/srv/www/media' && sync+  sudo rm -Rf '/srv/www/media' && sudo tar -xzf ~/'piwigo-files-'*'.tar.gz' -C '/srv/www' 'media' && sudo chown -R 'wwwrun':'www' '/srv/www/media' && sync
  
-==== Drop Previous Database ==== +===== Clean-up =====
- +
-  sudo mariadb +
- +
-  DROP DATABASE piwigo; +
- +
-  FLUSH TABLES; +
- +
-  EXIT +
- +
-==== Re-create Databases ==== +
- +
-  sudo mariadb +
- +
-  CREATE DATABASE piwigo; +
- +
-  EXIT +
- +
-===Restore Database ====+
  
 **** ****
  
-  sudo mariadb 'piwigo'~/'piwigo-database-'*'.sql&& sync+  rm -fv ~/'piwigo-files-'*'.tar.gz'
  
-==== Reapply Permissions ====+====== Database ======
  
-  sudo mariadb +===== Backup =====
- +
-  GRANT ALL PRIVILEGES ON piwigo.* to 'piwigo'@'localhost' IDENTIFIED BY 'x'; +
- +
-  FLUSH PRIVILEGES; +
- +
-  EXIT +
- +
-==== Start Services ====+
  
 **** ****
  
-  sudo systemctl start nginx php-fpm+  sudo mariadb-dump --single-transaction --quick 'piwigo' -r ~/'piwigo-database-manual-'$(date +%Y-%m-%d)'.sql'
  
-==== Remove Backups ====+===== scp =====
  
-  * Verify that Piwigo works before running+==== To Client Backup ====
  
-  rm ~/'piwigo-files-'*'.tar.gz' ~/'piwigo-database-'*'.sql' && sync+  * Server back-up -> Client 
 +  Run on server
  
-====== Database TODO ======+  scp espionage724@192.168.1.152:~/'piwigo-database-'*'.sql' ~/'Downloads'
  
-===== Backup =====+==== To Server Restore ====
  
-****+  Client -> (files) -> Server 
 +  Run on client
  
-  sudo mariadb-dump --single-transaction --quick 'piwigo' -r ~/'piwigo-database-manual-'$(date +%Y-%m-%d)'.sql'+  scp ~/'Downloads/piwigo'*'.sql' espionage724@192.168.1.152:~
  
 ===== Restore ===== ===== Restore =====
- 
-  sudo mariadb --execute='DROP DATABASE piwigo' 
  
   sudo mariadb --execute='CREATE DATABASE piwigo'   sudo mariadb --execute='CREATE DATABASE piwigo'
  
-  sudo mariadb 'piwigo' < ~/'piwigo-database-manual-'*'.sql' +  sudo mariadb 'piwigo' < ~/'piwigo'*'.sql'
- +
-==== Reapply Permissions ====+
  
-  * [[#databases|Initial Databases Set-up]]+==== Permissions ====
  
   sudo mariadb   sudo mariadb
 +
 +  CREATE USER 'piwigo'@'localhost' IDENTIFIED BY 'x';
  
   GRANT ALL PRIVILEGES ON piwigo.* to 'piwigo'@'localhost';   GRANT ALL PRIVILEGES ON piwigo.* to 'piwigo'@'localhost';
Line 499: Line 433:
  
   EXIT   EXIT
 +
 +===== Clean-up =====
 +
 +****
 +
 +  rm -fv ~/'piwigo'*'.sql'
  
/usr/local/www/wiki/data/attic/servers/linux/nginx/piwigo.1756337867.txt.gz · Last modified: by Sean Rhone