* Mail service config
The mail config has been completed. Due to the poor access to Vicnet server, we will not be able to config the mail service as we wish. Still, I found out a workaround, and I can guarantee all users will receive mails from marinecare right in their inbox ;)
* Backup, restore and replicate.
To back up the entire Joomla content, we need to back up the database and the whole Joomla files and directories
I was spending almost a whole day thinking about what would be the best strategy for backup and restore lolzz.
The tricky thing is, I dont wanna rely on any Joomla extension, so the whole backup and restore procedure is all about commands.
Im happy because it sounds pretty sophisticated :D
The whole testing content will be archived every 2 hours, from 8am to 4am.
The whole marinecare content will be archived every day, at 5am
https://unix-kernel.org/backup
Those periodic tasks can be executed with cron, a very well known deamon in *nix environment.
Access to that directory should be set with authentication, but I guess nobody except us would care about those files, so I leave them as open access :p
1. Backup marinecare database
Vicnet doesnt give us ssh access (sure they dont). There are some methods to backup the database with PHP but they all fail because of PHP environment in the server. The only script is successful is here:
http://marinecare.org.au/dbdump.php
So I wrote a command to download the file, put it in appropriate directory, set the file name with time.
1. Backup testing database
PHP environment in this server is quite strict, all PHP backup scripts fail. Fortunately I have ssh access to that server, so it will make my life a bit easier.
Normally the ssh server will ask for password when you attempt to connect, and this is problem for the automate task. The passwordless login can only be done with private/public key pair.
Once logged in, use mysqldump command to back up the database, put it somewhere in the server.
In my local workstation, retrieve that file, set file name with time, put it in a appropriate directory
3. Backup and replicate files and directories (both sites)
I use lftp, a command line ftp client to sync file with the server. When sync process is finished, a archive copy with proper time file name will be created.
4. Replicate database
Once you have the database snapshot, you need to restore it back with mysql command.
Here are exactly clone of 2 sites after replication:
https://unix-kernel.org/stephenpham
https://unix-kernel.org/marinecare
You guys can have a look at the scripts I wrote for those tasks here:
No comments:
Post a Comment