revised 10-Sep-2021
Part A: The application framework
Following the same framework and example naming outlined in setting up Wordpress where the application is in the sub-directory /var/www/wordpress, one logons the server, via PuTTY, and enters the following commands:
//where YYMMDD stands for the year, month and day – the day of the backup.
Part B: The Wordpress Database
Method 1: Via Webmin, go to [Servers]->[MySQL Database Server], click on the Wordpress database (wordpressdb). At the bottom of the page of tables, there is a button [Backup Database] then activate the button left of [Download in Browser], then click finally the button [Backup Now]. The following dialogue box gives one the option to download the database backup (.sql) to the Download folder. Rename the file: wordpressdbYYMMDD.sql as per the download date.
Method 2: Logon to the server, via PuTTY as the regular user, and enter the following commands:
Note: that there is no space nor brackets between “-p” and the mysqlrootpassword to be used is from the iRedmail setup (logon to the postmaster's mailbox (eg. postmaster@example.com) to retrieve such details).
Using FileZilla, one can then download these two files (eg.wordpressYYMMDD.tar.gz and wordpressdbYYMMDD.sql ) and store them securely.
First Wordpress Database, then the Application Backup
In reverse order from the backup procedure, one first restores the database. Using FileZilla, upload to the regular user's home directory (eg. /home/sammy), the two backup files; the wordpressdbYYMMDD.sql file and the wordpressYYMMDD.tar.gz. Logon to the server, via PuTTY, and enter the following commands:
Note: If the restore is for correcting a damaged database, then the database alone could be sufficient.
To do this, open wordpressdbYYMMDD.sql in a text editor (eg. Notepad++) and, using “Find and Replace”, find all entries with the old doman [eg. http://example.com] with new [eg. http://example-new.com]. Similarly, the old directory local (eg. /var/www/html/wordpress) replaced with the new one (eg. /var/vsite/wordpress).
Wordpress | Wordpress Backup |