All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Debian with Wordpress/ Lighttpd / MySQL/ PhP
I configured Debian 7 with Lighttpd + MySQL + PHP + Wordpress on a 128MB VPS. All worked fine. Last week, the server HDD crashed and all VPS needed to be re-created. Because it was a small VPS and cheap, the host did not offer any backup. I really did not expect any crashes to happen and I did not have any active content on the VPS. But, I had done a lot of configuration for setting up an optimized version of lighttpd, mysql, php and wordpress manually on the Debian server.
a. Is there any way to backup/ replicate the setup configuration so that I can use it later if needed?
b. Will I be able to restore the configurations on the same vps/ a new vps should something like this happen in future?
c. I also tweaked wordpress. is it possible to simply save the whole wordpress somewhere so that I can restore it without least hassel?
Thanks in advance for your help.
Comments
If you can make an SQL dump of the database and copy the config files and move them to the new VPS
I personally keep all my websites and config files in a private git repository (with bitbucket), so you're able to quickly deploy it elsewhere if needed. You can also keep database dumps in the same repository.
There are several WordPress backup plugins to back up WordPress database and configurations, you can ftp those files to other hosts if you want to.
Backing up the server configuration is easy since it does not typically change very often.
For your webserver config:
dpkg --get-selections will give you a list of installed packages so you know exactly what needs to be re-installed.
Restoring the server configuration would be as simple as installing the packages, renaming those 3 directories, i.e. mv /etc/nginx /etc/nginx-original, then extracting the tar and restarting nginx/php5-fpm/mysql.
For WordPress you can use a backup plugin, or a simple shell script running on cron job. I prefer the bash script to the plugin as I believe the less WordPress plugins the better and the bash script will be more reliable. i.e.
If you have configured a .my.cnf in your home directory, or /root if you're the root user, you probably won't need your username/password included with mysqldump.
All that's left is to SCP or rsync the backups offsite. I use a very similar process to backup my website's daily.
Use mysqldump in an hourly crontab, and use bittorrent sync to sync these files to your desktop or to another cheap VPS.
nm I just realized that @nunim got it all nicely wrapped up... removed my comment
@nunim, thank you for the detailed instructions. It is amazing. I will try it out this week and see how it comes into play.
A followup question for WordPress. i setup Wordpress multisite. So, what will be the best way to backup the wp-config and site details? or will I need to configure it separately all the time?
i prefer to use script like tuxlite to build my server
Great tip, @nunim, thanks!
And if I googled my Google correctly, to reinstall packages from that list you would:
I put all of my config directories (nginx, php5-fpm, etc) into a git repo and commit every time I make a change.
It has the added advantage of allowing me to rollback if I make any mistakes.